Gate::allows PHP 메소드

allows() 공개 정적인 메소드

Determine if the given ability should be granted for the current user.
public static allows ( string $ability, array | mixed $arguments = [] ) : boolean
$ability string
$arguments array | mixed
리턴 boolean
        public static function allows($ability, $arguments = array())
        {
            return \Illuminate\Auth\Access\Gate::allows($ability, $arguments);
        }

Usage Example

예제 #1
0
파일: Admin.php 프로젝트: atarget/starter
 /**
  * Handle an incoming request.
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  \Closure  $next
  * @return mixed
  */
 public function handle($request, \Closure $next)
 {
     if (\Gate::allows("admin")) {
         return $next($request);
     }
     die(view("unauthorized"));
 }
All Usage Examples Of Gate::allows