feat: limit storage check emails

feat: sentinel should send storage usage
This commit is contained in:
Andras Bacsai
2024-10-22 14:01:36 +02:00
parent 0a26598093
commit ac768e5313
14 changed files with 111 additions and 49 deletions

View File

@@ -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;