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
Enjoyed This Tip?
Get access to all premium tutorials, video and text courses, and exclusive Laravel resources. Join our community of 10,000+ developers.
Recent Courses
Laravel Coding with AI Agents: Cursor, Claude Code, Codex
5 lessons
1 h 01 min
PhpStorm Junie AI for Laravel Projects: Crash Course
7 lessons
36 min
Claude Code for Laravel Projects: Crash Course
8 lessons
48 min