本文整理汇总了PHP中Illuminate\Auth\AuthManager::guest方法的典型用法代码示例。如果您正苦于以下问题:PHP AuthManager::guest方法的具体用法?PHP AuthManager::guest怎么用?PHP AuthManager::guest使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Illuminate\Auth\AuthManager
的用法示例。
在下文中一共展示了AuthManager::guest方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: set
/**
* 임시 데이터 저장
*
* @param string $key 구분할 수 있는 키(중복가능)
* @param mixed $val 저장될 내용
* @param array $etc 기타 값들
* @param bool $isAuto 자동 저장 인지 여부
* @return TemporaryEntity
*/
public function set($key, $val, array $etc = [], $isAuto = false)
{
if ($this->auth->guest()) {
return null;
}
$temporary = new TemporaryEntity();
$temporary->fill(['userId' => $this->auth->user()->getId(), 'key' => $key, 'val' => $val, 'etc' => serialize($etc), 'isAuto' => $isAuto ? 1 : 0]);
return $this->repo->insert($temporary);
}
示例2: validateRouteUser
/**
* Check if a route has role control enabled(via filter)
* If the route has role control enabled we check against
* the provided user
*
* @param \Illuminate\Database\Query\Builder $query
* @return boolean
*/
protected function validateRouteUser($query)
{
if ($this->hasRoleControl($query)) {
if ($this->auth->guest() || !$this->checkRouteAgainstUser($query)) {
return false;
}
}
return true;
}
示例3: filter
public function filter(Route $route, Request $request)
{
if ($this->auth->guest()) {
return $this->makeResponse($request);
}
}