# fluent-cart/1.6.4/app/Events/Subscription/SubscriptionUpdated.php

FluentCart A New Era of eCommerce – Faster, Lighter, and Simpler, version 1.6.4. 55 lines.

- Page: https://pluginprobe.com/plugins/fluent-cart/1.6.4/code/app/Events/Subscription/SubscriptionUpdated.php
- Raw: https://pluginprobe.com/plugins/fluent-cart/1.6.4/raw/app/Events/Subscription/SubscriptionUpdated.php
- Modified: 2026-07-29T13:15:28+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/fluent-cart/1.6.4/code/app/Events/Subscription/SubscriptionUpdated.php#L10-L20`.

```php
<?php

namespace FluentCart\App\Events\Subscription;

use FluentCart\App\Events\EventDispatcher;
use FluentCart\App\Models\Customer;
use FluentCart\App\Models\Order;
use FluentCart\App\Models\Subscription;

class SubscriptionUpdated extends EventDispatcher
{
    public string $hook = 'fluent_cart/subscription_updated';
    protected array $listeners = [];

    public Subscription $subscription;
    public ?Order $order;
    public ?Customer $customer;
    public array $updates;
    public array $changes;

    public function __construct(Subscription $subscription, ?Order $order = null, ?Customer $customer = null, array $updates = [], array $changes = [])
    {
        $this->subscription = $subscription;
        $this->order = $order;
        $this->customer = $customer;
        $this->updates = $updates;
        $this->changes = $changes;
    }

    public function toArray(): array
    {
        // Superset payload — keeps the original `subscription`/`updates`/`changes` keys the bare
        // do_action('fluent_cart/subscription_updated') used, adds order/customer.
        return [
            'subscription' => $this->subscription,
            'updates'      => $this->updates,
            'changes'      => $this->changes,
            'order'        => $this->order,
            'customer'     => $this->customer ?? [],
        ];
    }

    public function getActivityEventModel(): Subscription
    {
        return $this->subscription;
    }

    public function shouldCreateActivity(): bool
    {
        // updateSubscription() already writes a detailed addLog() entry listing the
        // changed fields. Skipping the generic Activity row keeps the timeline unchanged.
        return false;
    }
}

```
