/** * Handle an incoming request. * * @param \Illuminate\Http\Request $request * @param \Closure $next * @return mixed */ public function handle($request, Closure $next) { $id = $request->id; if (!$this->repository->isOwner($id, Authorizer::getResourceOwnerId())) { return response()->json(['error' => true, 'message' => ['owner' => 'You are not an authorized user in this project']], 403); } return $next($request); }