In Laravel, there is a function return back();
, which returns the user to the previous page. Is it possible to return back();
more than once within one function to return the user back twice or several times? I tried
public function ....()
{
return back();
return back();
}
but it doesn't seem to work.
No, but you could use session system to save URLs of 2-3-4 pages back. Use
Session::
facade orsession()
helper for shorter syntax:And to use it: