EventServiceProvider.php 556B

123456789101112131415161718192021222324
  1. <?php
  2. namespace Illuminate\Events;
  3. use Illuminate\Support\ServiceProvider;
  4. use Illuminate\Contracts\Queue\Factory as QueueFactoryContract;
  5. class EventServiceProvider extends ServiceProvider
  6. {
  7. /**
  8. * Register the service provider.
  9. *
  10. * @return void
  11. */
  12. public function register()
  13. {
  14. $this->app->singleton('events', function ($app) {
  15. return (new Dispatcher($app))->setQueueResolver(function () use ($app) {
  16. return $app->make(QueueFactoryContract::class);
  17. });
  18. });
  19. }
  20. }