I made a duplication of the mercadolibre application for study purposes only.
Add this "favorites" button ({image circle 1}) and the problem is as follows:
When they click on the button and you are not logged in, it redirects you to the login form. Then you log in and it is redirected to the previous page, then you can successfully add to favorites. But when I use the "return to list" button ({image circle 2}), which is a javascript:history.back () then it sends me a "page not found" error. Any idea how to fix it?
this is what i used in my LoginComtroller.php to redirect to the previous page after login
public function showLoginForm(Request $request)
{
if(!session()->has('url.intended'))
{
session(['url.intended' => url()->previous()]);
}
return view('auth.login');
}
Ps: sorry for my bad english
