On this page
Available Events
wind will fire these events:
-
LaraZeus\Wind\Events\LetterSent
when a new letter sent from the website -
LaraZeus\Wind\Events\ReplySent
when you send a replay from the admin panel -
LaraZeus\Wind\Events\NewLetterSent
when you send a new letter from the admin panel
Register a Listener:
- first create your listener:
1php artisan make:listener SendWindNotification --event=LetterSent
- second register the listener in your
EventServiceProvider
1protected $listen = [2 //...3 LetterSent::class => [4 SendWindNotification::class,5 ],6];
- finally, you can receive the letter object in the
handle
method, and do what ever you want. for example:
1Mail::to(User::first())->send(new \App\Mail\Contact(2 $event->letter->name, $event->letter->email, $event->letter->message3));