This commit is contained in:
2018-11-05 21:53:21 -06:00
parent 1735935e45
commit 6e0de53c1f
+3 -2
View File
@@ -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;