opnform/app/Models/Billing/Subscription.php

22 lines
485 B
PHP
Raw Permalink Normal View History

2023-12-03 14:02:48 +00:00
<?php
namespace App\Models\Billing;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Laravel\Cashier\Subscription as CashierSubscription;
class Subscription extends CashierSubscription
{
use HasFactory;
public static function booted(): void
{
static::saved(function (Subscription $sub) {
$sub->user->flushCache();
});
static::deleted(function (Subscription $sub) {
$sub->user->flushCache();
});
}
}