Owl\Http\Middleware\OwnerCheckMiddleware::handle PHP Method

handle() public method

Handle an incoming request.
public handle ( Illuminate\Http\Request $request, Closure $next ) : mixed
$request Illuminate\Http\Request
$next Closure
return mixed
    public function handle($request, Closure $next)
    {
        $user = $this->userService->getCurrentUser();
        if ($user->role != UserRoleService::ROLE_ID_OWNER) {
            return redirect('/');
        }
        return $next($request);
    }
OwnerCheckMiddleware