I have a users table with a field called 'role', 0 - regular users, 1 - admin.
I have multiple controllers that only the admin uses. What is the easiest way to only allow users with a role of 1 to use them? I will have all these controllers in a folder called 'admin'.
Currently I have an if test in my routes.php file like this
if(Auth::user()->role == 1) {
Route::resource('someRes', 'someResController');
}
But I have come to realize this is the wrong way to do it.