check if not logged in laravel code example Example: get id user login laravel use Auth; $user_id = Auth::user()->id;