1 | <?php declare(strict_types=1); |
||
16 | abstract class AggregateServiceProvider extends LaravelServiceProvider |
||
17 | { |
||
18 | /** |
||
19 | * |
||
20 | */ |
||
21 | public function boot() |
||
22 | { |
||
23 | /** @var EventDispatcher $eventDispatcher */ |
||
24 | $eventDispatcher = $this->app->make(EventDispatcher::class); |
||
25 | |||
26 | foreach ($this->getEventSubscribers() as $eventSubscriber) { |
||
27 | $eventDispatcher->addSubscriber($this->app->make($eventSubscriber)); |
||
28 | } |
||
29 | |||
30 | } |
||
31 | |||
32 | /** |
||
33 | * @return array |
||
34 | */ |
||
35 | abstract public function getEventSubscribers(); |
||
36 | |||
37 | } |
||
38 |