F
Filamentβ€’14mo ago
ianclemence

Redirect customer to home page after they login or logout

I have three panels in my app: Admin, Vendor and Customer(default). All three panels use filament's authentication features. In the customer's panel provider, I have added the path to be empty: $panel->path(' '). I want when a customer logs in to the system through Filament's login page, they should be redirected to the homepage and not the panel's dashboard. The customers can still visit the filament dashboard through the /dashboard. How can I achieve this functionality? Has anyone tried something similar before?
Solution:
<?php namespace App\Filament; use Filament\Http\Responses\Auth\Contracts\LogoutResponse as Responsable;...
Jump to solution
7 Replies
PabloZagni
PabloZagniβ€’13mo ago
I've found this and solved it !!
PabloZagni
PabloZagniβ€’13mo ago
GitHub
Redirect of the logout to home page Β· filamentphp filament Β· Discus...
Please, how do I redirect my logout to home page of my front end? I currently, if I log out from admin dashboard, it redirect me to login page of the filament admin login. I want a way to redirect ...
PabloZagni
PabloZagniβ€’13mo ago
No description
PabloZagni
PabloZagniβ€’13mo ago
crear app\Filament\MyLogoutResponse.php
Solution
PabloZagni
PabloZagniβ€’13mo ago
<?php namespace App\Filament; use Filament\Http\Responses\Auth\Contracts\LogoutResponse as Responsable; use Illuminate\Http\RedirectResponse; class MyLogoutResponse implements Responsable { public function toResponse($request): RedirectResponse { return redirect()->to( route('home'), // put the name of your home route here ); } }
ianclemence
ianclemenceOPβ€’13mo ago
Worked like a charm. Thank you 😊
PabloZagni
PabloZagniβ€’13mo ago
Mark answer as solved πŸ˜‰
Want results from more Discord servers?
Add your server