vendredi 22 novembre 2019

Laravel Protected Route With same Model

I changed the users table and put a field called "role" and was wondering if it is possible to use middleware to protect routes only by checking this field.
The table users:
enter image description here

I wnated something like this:
If user role == 0

Route::group(['middleware' => 'auth'], function () {});

If user role == 1

Route::group(['middleware' => 'auth:customers'], function () {});

However with the same table



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire