Hi,
In my project I use Laravel with Inertia.
I would like to open some product from different pages (for example, from main page, catalog or search page) and have possibility to return to this page clicking "Back" link.
I've tried to use "return redirect()->back();" in route, but suppose this construction is not for such purposes!
Two weeks later: I find myself in need of a back button in a different project. Completely forgot I had already solved the issue before, so I turn to google and end up here (again!). Lo and behold, I find my own solution. LOL
I run into a bug with this method where sometimes the previous URL is a different site. Is there a way to avoid going back if it will take the user to another site?