Redirect URL to previous route in Laravel

To return back to the previous route in Laravel simply just use the back() method:

return back();

back() will create a new redirect response.

You can of course return back with a session message, the first value being the key and the second the value (message).

return back()->with('failed', 'There was an error');