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 2ad6982
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 get_class($this) === __CLASS__ && static::$shouldDiscoverEvents === true;
}

return parent::shouldDiscoverEvents();
}
}

0 comments on commit 2ad6982

Please sign in to comment.