role] = $r->rank; } $check = UserRole::where('character_id', auth()->user()->character_id)->get(); if($check->isEmpty()) { abort(403, "No users found in the database"); return $next($request); } if(!isset($check[0]->role)) { abort(403, "You don't have any roles."); } if($ranking[$check[0]->role] < $ranking[$role]) { abort(403, "You don't have the correct role to be in the area."); } return $next($request); } }