<?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($cookieJar, 15);
$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.';
}