1
I have a page with a "back" link. Is there any way to call the method back()
of Laravel within the href
of the link?
That code doesn’t work, but I want something like
href="{{URL::to(back())}}"
1
I have a page with a "back" link. Is there any way to call the method back()
of Laravel within the href
of the link?
That code doesn’t work, but I want something like
href="{{URL::to(back())}}"
1
try the following:
href="{{URL::previous()}}"
You can also do with javascript:
<a href="#" onclick="window.history.go(-1);">...</a>
Browser other questions tagged laravel-5
You are not signed in. Login or sign up in order to post.
It didn’t work. It went back to the previous page I wanted, IE, returned two pages.
– Amanda Lima
Strange, I just tested and it worked here. And why doesn’t use javascript @Amandalima?
<a href="#" onclick="window.history.go(-1);return false;">...</a>
– Miguel
Maybe it didn’t work because the page I want to go back to is coming from a form. When I used
{{URL::previous()}}
back to the form page.– Amanda Lima
Javascript worked, thank you!
– Amanda Lima
You’re welcome @Amandalima. I’ll edit the answer to include this alternative as well
– Miguel