本文整理匯總了PHP中app\User::inRole方法的典型用法代碼示例。如果您正苦於以下問題:PHP User::inRole方法的具體用法?PHP User::inRole怎麽用?PHP User::inRole使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類app\User
的用法示例。
在下文中一共展示了User::inRole方法的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: reset
public function reset(User $user, $code)
{
if (!$user->inRole('admins')) {
if (!empty($code)) {
return view('auth.reset', compact('code', 'user'));
}
return redirect()->route('forgot')->with('fail', 'کد امنیتی جهت بازیابی کلمه عبور صحیح نمی باشد.');
}
return redirect()->route('forgot')->with('fail', 'بازیابی کلمه عبور برای این حساب کاربری مقدور نمی باشد.');
}
示例2: destroy
public function destroy(User $user, Comment $comment)
{
return $user->id === $comment->from_user_id || $user->id === $comment->to_user_id || $user->inRole('admins');
}
示例3: destroy
public function destroy(User $user, Post $post)
{
return $user->id === $post->user_id || $user->inRole('admins');
}
示例4: destroy
public function destroy(User $user, Subcategory $Subcategory)
{
return $user->id === $Subcategory->user_id || $user->inRole('admins');
}
示例5: destroy
public function destroy(User $user, Edu $edu)
{
return $user->id === $edu->user_id || $user->inRole('admins');
}
示例6: destroy
public function destroy(User $user, Skill $skill)
{
return $user->id === $skill->user_id || $user->inRole('admins');
}
示例7: destroy
public function destroy(User $user, Resume $resume)
{
return $user->id === $resume->user_id || $user->inRole('admins');
}
示例8: destroy
public function destroy(User $user, Lang $lang)
{
return $user->id === $lang->user_id || $user->inRole('admins');
}
示例9: destroy
public function destroy(User $user, Xp $xp)
{
return $user->id === $xp->user_id || $user->inRole('admins');
}