本文整理汇总了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');
}