本文整理匯總了PHP中App\Http\Requests\Auth::check方法的典型用法代碼示例。如果您正苦於以下問題:PHP Auth::check方法的具體用法?PHP Auth::check怎麽用?PHP Auth::check使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類App\Http\Requests\Auth
的用法示例。
在下文中一共展示了Auth::check方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: authorize
/**
* Determine if the user is authorized to make this request.
*
* @return bool
*/
public function authorize()
{
if ($this->isUpdate()) {
return Post::findOrFail($this->get('id'))->user_id == \Auth::id();
}
return \Auth::check();
}
示例2: authorize
/**
* Determine if the user is authorized to make this request.
*
* @return bool
*/
public function authorize()
{
if (\Auth::check()) {
return true;
}
return false;
}
示例3: authorize
/**
* Determine if the user is authorized to make this request.
*
* @return bool
*/
public function authorize()
{
if (Auth::check() && Auth::user()->hasAccess('create_paper')) {
return true;
}
return false;
}
示例4: authorize
public function authorize()
{
// Only allow logged in users
return \Auth::check();
// Allows all users in
// return true;
}
示例5: authorize
/**
* Determine if the user is authorized to make this request.
*
* @return bool
*/
public function authorize()
{
return \Auth::check();
}
示例6: authorize
/**
* Determine if the user is authorized to make this request.
*
* @return bool
*/
public function authorize()
{
if (\Auth::check('auth')) {
return true;
}
}