-
Notifications
You must be signed in to change notification settings - Fork 34
Closed
Description
- Laravel Version: 9
- Nova Version: 10
- PHP Version: 8.2
- Database Driver & Version: MySQL 8.1
- Operating System and Version: MacOS
- Browser type and version: Chrome
- Reproduction Repository: https://github.com/HeadStudios/novaissue-5456-nonova
Description:
I am attempting to redirect a user based on role (I use Spatie) on their first login however no matter what I try nothing seems to work - I have tried register() function in Nova Service Provider as suggested in docs however this is not redirecting me:
public function register()
{
$user = request()->user();
if ($user) {
if ($user->hasRole('super-admin')) {
dump("You are super!");
Nova::initialPath('/resources/campaigns');
} elseif ($user->hasRole('importer')) {
dump("Come in importer!");
Nova::initialPath('/csv-import');
} else {
// default path for other roles
Nova::initialPath('/resources/users');
}
}
}The dump is coming through but the user is still going to dashboard by default. Thank you!
Detailed steps to reproduce the issue on a fresh Nova installation:
Metadata
Metadata
Assignees
Labels
No labels