You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
I need to redirect user with inactive status to login page + I want display error message.
How to do this?
NovaServiceProvider.php:
/** * Configure the Nova authorization services. * * @return void */protectedfunctionauthorization()
{
$this->gate();
Nova::auth(function ($request) {
if (Gate::check('viewNova', [$request->user()])) {
returntrue;
}
Auth::logout();
abort(redirect(route('nova.login'))->with('warning', 'You do not have permission to access this page!')); // <- the message not displayed
});
}
/** * Register the Nova gate. * * This gate determines who can access Nova in non-local environments. * * @return void */protectedfunctiongate()
{
Gate::define('viewNova', function ($user) {
if ($user->is_active === true) {
returntrue;
}
returnfalse;
});
}
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I need to redirect user with inactive status to login page + I want display error message.
How to do this?
NovaServiceProvider.php:
Beta Was this translation helpful? Give feedback.
All reactions