laravel/framework — pull request #4054 by blazeworx (2014-04-05 17:46:10+00:00)
Title: added '/' fallback for Redirect::back()

Added a fallback value `/` for `Redirect::back()`

Example scenario:

I have a filter `flag.check` on a route `/user/{id}/edit`, in this filter I check a condition and if it fails it should `Redirect::back()->with('error', 'You do not have sufficient permissions for this task');` to where the user came from and not allow access to the edit route. However, someone may try to hit the url directly if they know RESTful (or guess) the url structure. In this case it throws a `can not redirect to empty url` error.

With this change, if the user has typed the url into the browser it will redirect to `/` with the error message