App\Http\Middleware\Employee::handle PHP Method

handle() public method

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
return mixed
    public function handle($request, Closure $next, $guard = null)
    {
        $owner = Auth::user()->owner;
        if (!$owner instanceof ModelEmployee) {
            return response('Unauthorized.', 401);
        }
        return $next($request);
    }
Employee