Here is my backend code for checking user:
$user = $request->session()->get(‘user’);
if(empty($user)){ Session::flash(\'error_message\', \'P