Create a LoginResponse class in App\Http\Responses namespace.
The content of the class should be :
<?php namespace App\Http\Responses; use Filament\Http\Responses\Auth\Contracts\LoginResponse as LoginResponseContract; class LoginResponse implements LoginResponseContract{ /** * Create an HTTP response that represents the object. * * @param \Illuminate\Http\Request $request * @return \Symfony\Component\HttpFoundation\Response */ public function toResponse($request) { // return whatever you want as url $url = 'blabla'; return redirect()->intended($url); }}
then add in your service provider.
I tried this tips, but nothing happens. ray() confirms me that the code suggested by Shipu Ahamed is read in the boot() function of App\Service\Provider, but the call is not made in the first LoginResponse file. I'm pretty new with Laravel. There is something I don't understand certainly. My goal with that is that I want certain registered users not directed to the admin but to a specific page.
Works, but it is worth mentioning that code provided by @Shipu Ahamed should be placed in
RouteServiceProvider
, not inAppServiceProvider
.for keeping the logic. We could, I presume, create our own provider to separate what belongs to a specific app.
You can use it in AppServiceProvider file also just put it in register() function instead the boot().
Thanks for help @David VINCENT