Indeed, using {{ URL:previous() }} does work, but if you use the same route to display multiple views, it will return you to the first endpoint of that route.
In my case, I have a named route, which, based on a parameter selected by the user, can display 3 different views. Of course, I have a default case for the first input of this route, when the user has not yet selected any option.
When I use the URL:previous() , Laravel returns me to the default view, even if the user selects another option. Only using javascript inside the button I executed to get back to the correct view:
<a href="javascript:history.back()" class="btn btn-default">Voltar</a>
I tested this on Laravel 5.3, just for clarification.
Thiago Cardoso Mar 31 '17 at 16:49 2017-03-31 16:49
source share