I'm inside a module named "Authentication". After successful login with this module I want my user to redirect to home page (default page).
I tried the following route paths. But didn't worked.
$redirect = '/' ;
//$redirect = '' ;
//$redirect = null ;
return $this->redirect()->toRoute($redirect);
It generate the following error
Route with name "" not found
Home route is not defined in another module which i don't know. So how do i redirect to home page ?
If you can’t tell what is your home route name, you have at least two options:
Just redirect to /
:
return $this->redirect()->toUrl('/');