#is it possible to use single login page to redirect to their own panel based on role?

15 messages · Page 1 of 1 (latest)

oblique ruin
#

Im building an intern management app where there will be 3 roles such as admin, mentors, and interns.
im really wondering if you could use just a single login page then redirects them to their own panel based on their role? bare with me cause im really new to filament and laravel, thank you

zenith harness
#

Middleware is where you would want to handle this. But you’ll need to look into unifying the authentication of filament since panels are scoped to their own login routes out of the box. But it can be done.

oblique ruin
zenith harness
#

There’s not a guide because it’s not really a filament concept but more of a laravel concept.

#

Filament defaults to the Laravel authentication process.

oblique ruin
#

i see, but i really dont understand, i guess ill just add index homepage where there will button for each role login page

zenith harness
#

A middleware will have the authenticated user meaning you can check their roles/permissions and issue a redirect to the appropriate panel.

#

But you’ll need to include that middleware on each panel provider.

oblique ruin
#

Sorry if out of topic but for filament do you reccomend using filament shield plugin or spatie permission , im so confused about the difference beteween the two

light dirge
light dirge
oblique ruin
#

@light dirge @zenith harness thank you for teaching me a newbie in this tech filed and God bless (story time ,,actually im an intern in a pharma company and they told me to build an intern management app by myself in 3 months 🥹 )

slender juniper
#

I was looking for the same functionality and came accross this video
https://www.youtube.com/watch?v=9hRgCjDQDGw
Goes throught the solution in a bit more detail but at the core it uses @light dirge method of creating a CustomLoginResponse class

A 2-in-1 example of implementing roles: in the same panel or in separate panels? Also, building a common login form or not?

▶ Play video