diff --git a/app/User.php b/app/User.php index d5c6dd016..4a2e9cd19 100644 --- a/app/User.php +++ b/app/User.php @@ -48,8 +48,9 @@ class User extends Authenticatable //Used in middleware to make sure a user is able to access many of the pages public function hasRole($role) { - $charId = User::where('character_id')->get(); - $checks = DB::table('user_roles')->where('character_id', $charId)->get(); + $checks = User::roles()->get(); + //$charId = User::where('character_id')->get(); + //$checks = DB::table('user_roles')->where('character_id', $charId)->get(); foreach($checks as $check) { if($check['role'] == $role) { return true;