diff --git a/src/Illuminate/Auth/CreatesUserProviders.php b/src/Illuminate/Auth/CreatesUserProviders.php index 72eca2160b46..10ba6b70b841 100644 --- a/src/Illuminate/Auth/CreatesUserProviders.php +++ b/src/Illuminate/Auth/CreatesUserProviders.php @@ -27,9 +27,8 @@ public function createUserProvider($provider = null) $provider = $provider ?: $this->getDefaultUserProvider(); $config = $this->app['config']['auth.providers.'.$provider]; - $driver = Arr::get($config, 'driver'); - if (isset($this->customProviderCreators[$driver])) { + if (isset($this->customProviderCreators[$driver = Arr::get($config, 'driver')])) { return call_user_func( $this->customProviderCreators[$driver], $this->app, $config ); @@ -45,16 +44,6 @@ public function createUserProvider($provider = null) } } - /** - * Get the default user provider name. - * - * @return string - */ - public function getDefaultUserProvider() - { - return $this->app['config']['auth.defaults.provider']; - } - /** * Create an instance of the database user provider. * @@ -78,4 +67,14 @@ protected function createEloquentProvider($config) { return new EloquentUserProvider($this->app['hash'], $config['model']); } + + /** + * Get the default user provider name. + * + * @return string + */ + public function getDefaultUserProvider() + { + return $this->app['config']['auth.defaults.provider']; + } }