Illuminate\Foundation\Support\Providers\EventServiceProvider::boot PHP Method

boot() public method

Register the application's event listeners.
public boot ( ) : void
return void
    public function boot()
    {
        $events = app('events');
        foreach ($this->listen as $event => $listeners) {
            foreach ($listeners as $listener) {
                $events->listen($event, $listener);
            }
        }
        foreach ($this->subscribe as $subscriber) {
            $events->subscribe($subscriber);
        }
    }

Usage Example

Exemplo n.º 1
0
 /**
  * Register any other events for your application.
  *
  * @param  \Illuminate\Contracts\Events\Dispatcher  $events
  * @return void
  */
 public function boot(DispatcherContract $events)
 {
     parent::boot($events);
     User::deleting(function ($user) {
         \Event::fire(new UserWasDeleted($user->id));
     });
 }
All Usage Examples Of Illuminate\Foundation\Support\Providers\EventServiceProvider::boot
EventServiceProvider