Laravel Auth: check if user is a guest

Code
<?php

use Illuminate\Auth\SessionGuard;
use 
Illuminate\Cookie\CookieJar;
use 
Illuminate\Session\Store;
use 
Illuminate\Session\CookieSessionHandler;
use 
Illuminate\Auth\EloquentUserProvider;
use 
Illuminate\Hashing\BcryptHasher;
use 
Illuminate\Database\Eloquent\Model;
use 
Illuminate\Http\Request;

class 
Foo extends Model
{}

$cookieJar = new CookieJar();
$sessionHandler = new CookieSessionHandler($cookieJar15);
$sessionStore = new Store('myname'$sessionHandler);
$hasher = new BcryptHasher();
$userProvider = new EloquentUserProvider($hasher'Foo');
$request Request::createFromGlobals();

$guard = new SessionGuard('myname'$userProvider$sessionStore$request);

if (
$guard->guest()) {
    echo 
'Hello guest, you need to log in.';
}
Result
Hello guest, you need to log in.
Used Versions
PHP 8.2, Laminas MVC 3.2, Symfony 5.2, Laravel 8.28, PHPUnit 9.5, Doctrine ORM 2.8