App\Http\Middleware\Student::handle PHP 메소드

handle() 공개 메소드

Handle an incoming request.
public handle ( Illuminate\Http\Request $request, Closure $next, string | null $guard = null ) : mixed
$request Illuminate\Http\Request
$next Closure
$guard string | null
리턴 mixed
    public function handle($request, Closure $next, $guard = null)
    {
        $owner = Auth::user()->owner;
        if (!$owner instanceof ModelStudent) {
            return response('Unauthorized.', 401);
        }
        return $next($request);
    }
Student