lundi 2 septembre 2019

Laravel 5: check if user arrived at a page via url or back()

I would like to know if there is a way to find out if the user is hitting the page via URL or as a result of then back() method. this is what I mean:

$validator = Validator::make($request->all(), $rules);
if ($validator->fails()) {
    $request->session()->flash('message_error', trans('messages.errors'));
    return back()->withInput()->withErrors($validator);
}

There is a piece of logic I have to perform only when the user is hitting the page by a link or URL, but never when he's hitting as a result of the return back()

Thanks in advance for any help.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire