Skip to content

Commit

Permalink
feat(events): enable Laravel event discovery
Browse files Browse the repository at this point in the history
  • Loading branch information
Mohammad-Alavi committed Dec 13, 2024
1 parent a634f3a commit fb015ec
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/Abstracts/Providers/EventServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,18 @@

namespace Apiato\Core\Abstracts\Providers;

use Apiato\Core\Foundation\Facades\Apiato;
use Illuminate\Foundation\Support\Providers\EventServiceProvider as LaravelEventServiceProvider;

abstract class EventServiceProvider extends LaravelEventServiceProvider
{
public function shouldDiscoverEvents(): bool
{
return true;
}

protected function discoverEventsWithin(): array
{
return array_map(static fn (string $path) => $path . '/Listeners', Apiato::getAllContainerPaths());
}
}

0 comments on commit fb015ec

Please sign in to comment.