We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3e12ddf commit 5b802a6Copy full SHA for 5b802a6
src/Models/Banner.php
@@ -7,6 +7,7 @@
7
use Filament\View\PanelsRenderHook;
8
use Illuminate\Database\Eloquent\Factories\HasFactory;
9
use Illuminate\Database\Eloquent\Model;
10
+use Illuminate\Support\Facades\Cache;
11
use Laragear\TwoFactor\Contracts\TwoFactorAuthenticatable;
12
use Visualbuilder\Filament2fa\Database\Factories\BannerFactory;
13
@@ -46,6 +47,22 @@ class Banner extends Model
46
47
48
protected $table = 'two_factor_banners';
49
50
+ protected static function booted()
51
+ {
52
+ parent::booted();
53
+
54
+ // When a banner is created or updated
55
+ static::saved(function ($banner) {
56
+ Cache::forget('all_banners');
57
+ });
58
59
+ // When a banner is deleted
60
+ static::deleted(function ($banner) {
61
62
63
+ }
64
65
66
/**
67
* @return BannerFactory
68
*/
0 commit comments