diff --git a/composer.json b/composer.json index 27735a0..9c106ac 100644 --- a/composer.json +++ b/composer.json @@ -18,7 +18,7 @@ "minimum-stability": "dev", "require": { "php": "^8.0", - "illuminate/notifications": "~5.6 || ~6.0 || ~7.0 || ~8.0 || ~9.0" + "illuminate/notifications": ">=5.6 <11.0 || ^11.0" }, "config": { "sort-packages": true diff --git a/src/NotificationType.php b/src/NotificationType.php index d8ee742..c6f7994 100644 --- a/src/NotificationType.php +++ b/src/NotificationType.php @@ -54,7 +54,7 @@ public static function boot() { parent::boot(); $callback = function ($notificationType) { - cache()->forget("notifications:$notificationType->name"); + cache()->tags('notification_settings')->forget("notifications:$notificationType->name"); }; static::saved($callback); @@ -77,7 +77,7 @@ public function notifications() */ public static function isEnabled($notificationType) { - $settings = cache()->rememberForever("notifications:$notificationType", function () use ($notificationType) { + $settings = cache()->tags('notification_settings')->rememberForever("notifications:$notificationType", function () use ($notificationType) { return NotificationType::whereName($notificationType)->first(); }); diff --git a/src/Schedulable.php b/src/Schedulable.php index 47d728c..8750740 100644 --- a/src/Schedulable.php +++ b/src/Schedulable.php @@ -13,7 +13,7 @@ public function viaQueues() } $notificationType = get_class($this); - $settings = cache()->rememberForever("notifications:$notificationType", function () use ($notificationType) { + $settings = cache()->tags('notification_settings')->rememberForever("notifications:$notificationType", function () use ($notificationType) { return NotificationType::whereName($notificationType)->first(); });