diff --git a/src/Config/firewall.php b/src/Config/firewall.php index 77a9e16..d94a56a 100644 --- a/src/Config/firewall.php +++ b/src/Config/firewall.php @@ -40,6 +40,7 @@ 'name' => env('FIREWALL_EMAIL_NAME', 'Laravel Firewall'), 'from' => env('FIREWALL_EMAIL_FROM', 'firewall@mydomain.com'), 'to' => env('FIREWALL_EMAIL_TO', 'admin@mydomain.com'), + 'queue' => env('FIREWALL_EMAIL_QUEUE', 'default'), ], 'slack' => [ @@ -48,6 +49,7 @@ 'from' => env('FIREWALL_SLACK_FROM', 'Laravel Firewall'), 'to' => env('FIREWALL_SLACK_TO'), // webhook url 'channel' => env('FIREWALL_SLACK_CHANNEL', null), // set null to use the default channel of webhook + 'queue' => env('FIREWALL_SLACK_QUEUE', 'default'), ], ], diff --git a/src/Notifications/AttackDetected.php b/src/Notifications/AttackDetected.php index f1bbd01..eb1676d 100644 --- a/src/Notifications/AttackDetected.php +++ b/src/Notifications/AttackDetected.php @@ -21,10 +21,8 @@ class AttackDetected extends Notification implements ShouldQueue /** * The notification config. - * - * @var object */ - public $notifications; + public array $notifications; /** * Create a notification instance. @@ -58,6 +56,16 @@ public function via($notifiable) return $channels; } + /** + * Get the notification's queues. + * @return array|string + */ + + public function viaQueues(): array + { + return array_map(fn ($channel) => $channel['queue'] ?? 'default', $this->notifications); + } + /** * Build the mail representation of the notification. *