chore: use new notification trait
This commit is contained in:
parent
2639cf7544
commit
96c970ca4e
1 changed files with 3 additions and 2 deletions
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
namespace App\Notifications;
|
||||
|
||||
use App\Notifications\Channels\EmailChannel;
|
||||
use App\Notifications\Dto\DiscordMessage;
|
||||
use App\Notifications\Dto\SlackMessage;
|
||||
use Illuminate\Bus\Queueable;
|
||||
|
|
@ -23,13 +24,13 @@ public function __construct(public ?string $emails = null)
|
|||
|
||||
public function via(object $notifiable): array
|
||||
{
|
||||
return setNotificationChannels($notifiable, 'test');
|
||||
return $notifiable->getEnabledChannels('test');
|
||||
}
|
||||
|
||||
public function middleware(object $notifiable, string $channel)
|
||||
{
|
||||
return match ($channel) {
|
||||
\App\Notifications\Channels\EmailChannel::class => [new RateLimited('email')],
|
||||
EmailChannel::class => [new RateLimited('email')],
|
||||
default => [],
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue