Laravel Notification Event Subscriber is a package allows you to run any kind of action while a notification is being sent or after it has been sent using onSent() and onSending() methods. It registers an event subscriber NotificationEventSubscriber and listens to the NotificationSent and NotificationSending events of Laravel. When one of them is fired, the event subscriber runs a defined method according to the event.

Usage namespace App\Notifications; use Illuminate\Notifications\Messages\MailMessage; use Illuminate\Support\Facades\Log; class UserRegisteredNotification extends Notification { public function via($notifiable): array { return ['mail']; } public function toMail($notifiable): MailMessage { return (new MailMessage) ->greeting('foo') ->line('bar'); } public function onSending($channel): void { Log::info($this::class.

Our expert developers have plenty of experience in Laravel Custom Web Application Development.
Newsletter

Get the latest Laravel/PHP jobs, events and curated articles straight to your inbox, once a week

Fathom Analytics | Fast, simple and privacy-focused website analytics. Fathom Analytics | Fast, simple and privacy-focused website analytics.
Achieve superior email deliverability with ToastMail! Our AI-driven tool warms up inboxes, monitors reputation, and ensures emails reach their intended destination. Sign up today for a spam-free future. Achieve superior email deliverability with ToastMail! Our AI-driven tool warms up inboxes, monitors reputation, and ensures emails reach their intended destination. Sign up today for a spam-free future.
Community Partners