本文整理匯總了PHP中Illuminate\Auth\AuthManager::getDefaultDriver方法的典型用法代碼示例。如果您正苦於以下問題:PHP AuthManager::getDefaultDriver方法的具體用法?PHP AuthManager::getDefaultDriver怎麽用?PHP AuthManager::getDefaultDriver使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Illuminate\Auth\AuthManager
的用法示例。
在下文中一共展示了AuthManager::getDefaultDriver方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: getUser
/**
* Get User
*
* @return \Illuminate\Contracts\Auth\Authenticatable
*/
protected function getUser()
{
if (!$this->user) {
$authGuard = $this->config->get('nwlaravel.activity.auth_guard') ?: $this->auth->getDefaultDriver();
$this->user = $this->auth->guard($authGuard)->user();
}
return $this->user;
}
示例2: __construct
public function __construct(AuthManager $auth, Repository $config)
{
$this->auth = $auth;
$this->properties = collect();
$authDriver = $config['laravel-activitylog']['default_auth_driver'] ?? $auth->getDefaultDriver();
if (starts_with(app()->version(), '5.1')) {
$this->causedBy = $auth->driver($authDriver)->user();
} else {
$this->causedBy = $auth->guard($authDriver)->user();
}
$this->logName = $config['laravel-activitylog']['default_log_name'];
$this->logEnabled = $config['laravel-activitylog']['enabled'] ?? true;
}
示例3: getDefaultDriver
/**
* Get the default authentication driver name.
*
* @return string
* @static
*/
public static function getDefaultDriver()
{
return \Illuminate\Auth\AuthManager::getDefaultDriver();
}