How can I determine the path of the page from which the request was made?
I have tried $request->path()
or Request::path()
but these two return the path on which request is going..
How can I determine the path of the page from which the request was made?
I have tried $request->path()
or Request::path()
but these two return the path on which request is going..
You may try this:
$request->header('referer');
Also URL::previous
will give you that URL
, for example:
\URL::previous();
Update: You may use this to send a user back to form on failed validation:
return redirect()->back(); // You may use ->withInput()->withErrors(...) as well