you are reading the documentation for version
v1
our latest version is
v3
make sure to select the correct version.
to check your version use:
to check your version use:
composer show lara-zeus/bolt
On this page
Available Events
Bolt will fire these events:
-
LaraZeus\Bolt\Events\FormMounted
-
LaraZeus\Bolt\Events\FormSent
Register a Listener:
- First, create your listener:
1php artisan make:listener SendNotification --event=FormMounted
- Second, register the listener in your
EventServiceProvider
1protected $listen = [2 //...3 LetterSent::class => [4 SendNotification::class,5 ],6];
- Finally, you can receive the form object in the
handle
method and do whatever you want. For example:
1Mail::to(User::first())->send(new \App\Mail\Contact(2 $event->form->name, $event->letter->email, $event->letter->message3));