Q: having anonymous user on laravel I'm using Laravel 5.8. And I have created a custom Guard that is using jwt. That I use as a middleware for authenticating users. 
I have some routes that need to have different responses based on being an authenticated user or an unauthenticated user. what do you suggest me to do? what is the best practices to implement this?
I can define a custom guard which its check function always returns true.and returning an integer like -1 for unauthenticated user while the user is not authenticated.but it does not sound a clean way of implementing this.

A: Depending on how you want to set this up, you can just use the Auth facade helpers in your controller method to see whether a user is authenticated or not:
// SomeController.php
public function index(Request $request)
{
    if(Auth::guest()) {
        return response()->json('i am a guest');
    } else {
        return response()->json('im not a guest');
    }
}

or use any of the related methods:
    // Inverse of `Auth::guest()`
    $isLoggedIn = Auth::check();
    $loggedInUser = Auth::user();

https://laravel.com/api/5.8/Illuminate/Auth/GuardHelpers.html
