Answer the question
In order to leave comments, you need to log in
How to change authentication in SleepingOwl4?
In the old version, I changed it like this:
config/admin.php file
'auth' => [
'model' => '\SleepingOwl\AdminAuth\Entities\Administrator',
'rules' => [
'username' => 'required',
'password' => 'required',
]
],
'auth' => [
'model' => \App\User::class,
'rules' => [
'email' => 'required',
'password' => 'required',
]
],
'middleware' => ['admin.auth'],
'middleware' => ['isadmin'],
if (Sentinel::guest()) return redirect('/');
if(Sentinel::inRole('user')) return $next($request);
return Redirect::back();
'users' => [
'driver' => 'eloquent',
'model' => App\User::class,
],
Answer the question
In order to leave comments, you need to log in
Hello, well, actually, these are no longer admin problems, but more Laravel problems, I would even say not problems, but changes.
The documentation describes the process of changing the authorization algorithm:
In short, in Laravel 5.2, so-called guards appeared, which allow you to implement several authorization algorithms and use them in parallel, as well as choose the default authorization guard.
'defaults' => [
'guard' => 'sentinel', // Используемый по умолчанию
....
],
...
'guards' => [
...
'sentinel' => [
'driver' => 'session',
'provider' => 'sentinel',
],
],
...
'providers' => [
'sentinel' => [
'driver' => 'sentinel',
'model' => App\User::class,
'options' => [
....
],
],
],
Auth::extend('sentinel', function($app, $name, array $config) {
...
});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question