I have a laravel 5 backend that sends an jwt-token as a json response (with https://github.com/tymondesigns/jwt-auth). The user authentication works correctly.
What i need to do is to use jwt-token for admin authentication too. Admins are on different table named admin.
How can i use jwt-token for different tables?
I had similar problem and for me was enough just create route middleware and update auth.model (needed to change only \App\User to \App\Customer):
Config::set('auth.model', App\Customer::class);
Tables and other db things you should have defined in models, so above entry should do work.
It worked for me , I have 2 users client and salon_owner . To change I updated 2 things auth.model and jwt.user :
Config::set('jwt.user', 'App\Salon_owner');
Config::set('auth.providers.users.model', \App\SalonOwner::class);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With