If you want to implement a new listener to a specific event but you don't know its name, you can log all events fired during the request.
You can use the \Illuminate\Support\Facades\Event::listen()
method on boot()
method of app/Providers/EventServiceProvider.php
to catch all events fired.
Important: If you use the Log
facade within this event listener then you will need to exclude events named Illuminate\Log\Events\MessageLogged
to avoid an infinite loop.
(Example: if ($event == 'Illuminate\\Log\\Events\\MessageLogged') return;
)
// Include Event...use Illuminate\Support\Facades\Event; // In your EventServiceProvider class...public function boot(){ parent::boot(); Event::listen('*', function ($event, array $data) { // Log the event class error_log($event); // Log the event data delegated to listener parameters error_log(json_encode($data, JSON_PRETTY_PRINT)); });}
Tip given by @MuriloChianfa