getProviderConfiguration($provider))) { return null; } $driver = ($config['driver'] ?? null); if (isset($this->customProviderCreators[$driver])) { return call_user_func($this->customProviderCreators[$driver], $this->app, $config); } switch ($driver) { case 'eloquent': return $this->createEloquentProvider($config); default: throw new InvalidArgumentException( "Authentication user provider [{$driver}] is not defined." ); } } /** * Get the user provider configuration. * * @param string|null $provider * @return array|null */ protected function getProviderConfiguration($provider) { if ($provider = $provider ?: $this->getDefaultUserProvider()) { return $this->app['config']['auth.providers.' . $provider]; } return null; } /** * Create an instance of the database user provider. * * @param array $config * @return \bff\auth\EloquentUserProvider */ 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']; } }