The Laravel Artisan Cheatsheet now has an API. Learn more.

make:listener

Create a new event listener class

Options

  • event - The event class being listened for Optional
  • queued - Indicates the event listener should be queued Optional
  • test - Generate an accompanying PHPUnit test for the Listener Optional
  • pest - Generate an accompanying Pest test for the Listener Optional

Arguments

  • name - The name of the class Required
php artisan make:listener [-e|--event [EVENT]] [--queued] [--test] [--pest] [--] <name>