testing
This commit is contained in:
@@ -25,8 +25,12 @@ class RequireRole
|
||||
foreach($roles as $r) {
|
||||
$ranking[$r->role] = $r->rank;
|
||||
}
|
||||
|
||||
$check = UserRole::where('character_id', auth()->user()->character_id)->get(['role']);
|
||||
|
||||
$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.");
|
||||
|
||||
Reference in New Issue
Block a user