Skip to content
Permalink
Browse files

check if resolved

  • Loading branch information...
taylorotwell committed Apr 17, 2019
1 parent 4a25686 commit be89773c52e7491de05dee053b18a38b177d6030
Showing with 7 additions and 8 deletions.
  1. +7 −8 src/Illuminate/Auth/AuthServiceProvider.php
@@ -17,13 +17,9 @@ class AuthServiceProvider extends ServiceProvider
public function register()
{
$this->registerAuthenticator();
$this->registerUserResolver();
$this->registerAccessGate();
$this->registerRequestRebindHandler();
$this->registerEventRebindHandler();
}
@@ -77,7 +73,7 @@ protected function registerAccessGate()
}
/**
* Register a resolver for the authenticated user.
* Handle the re-binding of the request binding.
*
* @return void
*/
@@ -91,15 +87,18 @@ protected function registerRequestRebindHandler()
}
/**
* Register a resolver for the 'events' rebinding.
* Handle the re-binding of the event dispatcher binding.
*
* @return void
*/
protected function registerEventRebindHandler()
{
$this->app->rebinding('events', function ($app, $dispatcher) {
$guard = $app['auth']->guard();
if (method_exists($guard, 'setDispatcher')) {
if (! $app->resolved('auth')) {
return;
}
if (method_exists($guard = $app['auth']->guard(), 'setDispatcher')) {
$guard->setDispatcher($dispatcher);
}
});

0 comments on commit be89773

Please sign in to comment.
You can’t perform that action at this time.