diff --git a/app/Providers/AuthServiceProvider.php b/app/Providers/AuthServiceProvider.php index ebf1822d5..cb1c871a1 100644 --- a/app/Providers/AuthServiceProvider.php +++ b/app/Providers/AuthServiceProvider.php @@ -33,7 +33,7 @@ class AuthServiceProvider extends ServiceProvider $gate->define('isAdmin', function($user) { //Get the roles the user has from the user_roles table and check against the gate we are creating - $check = DB::table('user_roles')->where('character_id', auth()->user()->character_id)->get(['role']); + $check = UserRole::where('character_id', auth()->user()->character_id)->get(['role']); if($check[0]->role === 'Admin') { //User has the Admin role return true; @@ -44,7 +44,7 @@ class AuthServiceProvider extends ServiceProvider $gate->define('isDirector', function($user) { //Get the roles the user has from the user_roles table and check against the gate we are creating - $check = DB::table('user_roles')->where('character_id', auth()->user()->character_id)->get(['role']); + $check = UserRole::where('character_id', auth()->user()->character_id)->get(['role']); if($check[0]->role === 'Director') { //User has the Director role return true; @@ -55,7 +55,7 @@ class AuthServiceProvider extends ServiceProvider $gate->define('isUser', function($user) { //Get the roles the user has from the user_roles table and check against the gate we are creating - $check = DB::table('user_roles')->where('character_id', auth()->user()->character_id)->get(['role']); + $check = UserRole::where('character_id', auth()->user()->character_id)->get(['role']); if($check[0]->role === 'User') { //User has the User role return true; @@ -66,7 +66,7 @@ class AuthServiceProvider extends ServiceProvider $gate->define('isGuest', function($user) { //Get the roles the user has from the user_roles table and check against the gate we are creating - $check = DB::table('user_roles')->where('character_id', auth()->user()->character_id)->get(['role']); + $check = UserRole::where('character_id', auth()->user()->character_id)->get(['role']); if($check[0]->role === 'Guest') { //User has the Guest role return true; @@ -77,7 +77,7 @@ class AuthServiceProvider extends ServiceProvider $gate->define('isNone', function($user) { //Get the roles the user has from the user_roles table and check against the gate we are creating - $check = DB::table('user_roles')->where('character_id', auth()->user()->character_id)->get(['role']); + $check = UserRole::where('character_id', auth()->user()->character_id)->get(['role']); if($check[0]->role === 'None') { //User has no role return true;