After login procedure, if the user is non admin it takes user to site.dev/admin and nothing is displayed. instead of this my desired response is to navigate users to different dashboards based on the user role assigned
After a fresh installation of laravel and voyager
created a new route for dashboard /userdashboard for normal user
after login i want to redirect to /userdashboard if the user is a normal user
tried playing around with the routes for voyager but no success so far, i would like some assistance in figuring out exactly where and which route/file i need to edit, as i am unfamiliar with working on other packages customization on laravel.
also please note that i am new and trying to get the hang of it, any support is much appreciated.
stay awesome guys
any solutions for this prob?
Hi there, I haven't been able to get any solutions yet, for now I choose to go with native multiauth using guards and middleware for my current project.
But would love to see a solution tho this as voyager was very convenient :)
What other roles are you intending to use? Voyager is intended to be an "admin" tool, so normal "front-end" users of your site shouldn't be accessing it for any reason. If you have multiple levels of "admin" users, then you can control that through the existing permissions with other roles, so long as that role has the browse_admin permission.
I'm not sure what part of your use-case isn't covered by this. Please explain further.
so, only superadmins can view the template?
No. You can give different access to each role you create, but your role MUST have browse_admin if you need to be able to log into Voyager's interface. So, you can create a new Role with only browse_admin and whatever else they need access to, and they won't be able to get to the other functionality (Database, Settings, Pages/Posts, Users, etc.)
Late Answer but for the record:
I used the VoyagerController
Like so
class VoyagerController extends Controller
{
public function index()
{
if(Auth::user()->role_id == 1){
return Voyager::view('voyager::index');
}elseif(Auth::user()->role_id == 3){
return Redirect::action('XXXXXXXController@index');
}elseif(Auth::user()->role_id == 4){
return Redirect::action('IssuerController@index');
}else{
return view('voyager::XXXXXXX.cardholder');
}
}
@Eishaden, again, very old issue and it's been closed for months. Adding comments at this point is not beneficial
This issue has been automatically locked since there has not been any recent activity after it was closed. If you have further questions please ask in our Slack group.
Most helpful comment
No. You can give different access to each role you create, but your role MUST have
browse_adminif you need to be able to log into Voyager's interface. So, you can create a new Role with onlybrowse_adminand whatever else they need access to, and they won't be able to get to the other functionality (Database, Settings, Pages/Posts, Users, etc.)