Return to previous page

Blade Routing Views

Committed to the LaraBrain by: snapey at January 3, 2016 1:27 am

Easily return to the previous page by a simple URL helper

If you have several ways to reach a page, eg an author has multiple posts and when a user clicks on a post title and views the post, you want a back link that returns them to the previous view. Another time, the post is accessed from a search page, this time, you want the back to return to the search results.

Simply use URL::previous(). For instance:

<a href="{{ URL::previous() }}"><<< Back</a>