How to use fortify on multiple places for authentication #34401
Replies: 5 comments 8 replies
-
You can achieve this by using middle-wares and one (single) users table. Show a link to admin panel when user is admin ...etc!
Hope it help! |
Beta Was this translation helpful? Give feedback.
-
@AjithLalps Of course it is! That is how laravel works - I have a project that been using this method and just replaced laravel/ui with Fortify and nothing changed at all. |
Beta Was this translation helpful? Give feedback.
-
so I know that Roles are good.. but I have another scenario.. if I'm logged in as an admin, I still want to be able to log-in as customer... something like wordpress CMS works.. I have a login for the CMS and another login for the customer.. I should be able to login to both at the same time.. that should mean laravel would handle 2 guards at the same time.. sadly fortify does not support this.. you know, multi auth... Fortify should have a static function that authenticates a users by guard..
|
Beta Was this translation helpful? Give feedback.
-
https://max-eckel.dev/posts/multi-guard-authentication-with-laravel-fortify |
Beta Was this translation helpful? Give feedback.
-
@AjithLalps did you find a proper solution or workaround to your question? I am looking for the exact same thing: Two different login pages inside the project. The closest one to what you have asked is with the subdomain version which @koudera1 is also shared. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
A website has multiple users like - Admin, Registered users and Public users.
For Admin and registered users, we use different URL and both users have a different login form. maybe admin login will be at
webiste.com/admin/login
and user login will bewebsite.com/login
.When using jetstream fortify is used for authentication for
website.com/login
.How we can use fortify for
website.com/admin/login
? mainly in jetstream?Note: In earlier versions, we can copy-paste the auth folder completely to build a new login.
Beta Was this translation helpful? Give feedback.
All reactions