How to change authentication in SleepingOwl4?

In the old version I changed it so:
file config/admin.php
'auth' => [
 'model' => '\SleepingOwl\AdminAuth\Entities\Administrator',
 'rules' => [
 'username' => 'required',
 'password' => 'required',
]
 ],

on
'auth' => [
 'model' => \App\User::class,
 'rules' => [
 'email' => 'required',
 'password' => 'required',
]
 ],

'middleware' => ['admin.auth'],
on
'middleware' => ['isadmin'],
pre-writing in middleware
if (Sentinel::guest()) return redirect('/');
if(Sentinel::inRole('user')) return $next($request);
return Redirect::back();

and it worked, and now the settings are taken from config/auth.php
'users' => [
 'driver' => 'eloquent',
 'model' => App\User::class,
 ],

And now is not working (when you try to go to the admin panel returns to the main)
July 9th 19 at 13:17
1 answer
July 9th 19 at 13:19
Hi, well, actually this is not a problem admin, and more problems Laravel, I would even say are not problems, and changes.

The documentation describes the process of change authorization:



In short, the Laravel 5.2 there are so-called guard, which allow you to implement multiple authentication algorithms and use them in parallel, and choose Gard authorization used by default.

'defaults' => [
 'guard' => 'sentinel', // default
....
],
...
'guards' => [
...
 'sentinel' => [
 'driver' => 'session',
 'provider' => 'sentinel',
],
],
...
'providers' => [
 'sentinel' => [
 'driver' => 'sentinel',
 'model' => App\User::class,
 'options' => [
....
],
],
],


Auth::extend('sentinel', function($app, $name, array $config) {
...
});


Ie we create our own provider for authorization, make it a garden by default.
I understand that it is now possible for admin to highlight the eloquent authentication for frontend - sentinel, and api for anything else? (This for example) So that? Then it Courtauld. Flexible. But Need to get my head straight what this is - jules_Nolan10 commented on July 9th 19 at 13:22

Find more questions by tags Laravel