feat: limit storage check emails
feat: sentinel should send storage usage
This commit is contained in:
@@ -7,6 +7,7 @@ use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Notifications\Messages\MailMessage;
|
||||
use Illuminate\Notifications\Notification;
|
||||
use Illuminate\Queue\Middleware\RateLimited;
|
||||
|
||||
class Test extends Notification implements ShouldQueue
|
||||
{
|
||||
@@ -21,6 +22,14 @@ class Test extends Notification implements ShouldQueue
|
||||
return setNotificationChannels($notifiable, 'test');
|
||||
}
|
||||
|
||||
public function middleware(object $notifiable, string $channel)
|
||||
{
|
||||
return match ($channel) {
|
||||
'App\Notifications\Channels\EmailChannel' => [new RateLimited('email')],
|
||||
default => [],
|
||||
};
|
||||
}
|
||||
|
||||
public function toMail(): MailMessage
|
||||
{
|
||||
$mail = new MailMessage;
|
||||
|
||||
Reference in New Issue
Block a user