Skip to content

Commit

Permalink
Allow events AutoDiscovery in Laravel 11
Browse files Browse the repository at this point in the history
  • Loading branch information
DocLM committed May 2, 2024
1 parent 9c3e16f commit 26857e8
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/Platform/Providers/EventServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,18 @@ class EventServiceProvider extends ServiceProvider
LockUserForLogin::class,
],
];

/**
* Determine if events and listeners should be automatically discovered.
*
* @return bool
*/
public function shouldDiscoverEvents()
{
if(!isset(static::$shouldDiscoverEvents)) {
return parent::shouldDiscoverEvents();
}

return get_class($this) === __CLASS__ && static::$shouldDiscoverEvents === true);
}
}

0 comments on commit 26857e8

Please sign in to comment.