RequestGuard.php
public function user()
{
// If we've already retrieved the user for the current request we can just
// return it back immediately. We do not want to fetch the user data on
// every call to this method because that would be tremendously slow.
if (! is_null($this->user)) {
return $this->user;
}
return $this->user = call_user_func(
$this->callback, $this->request
);
}
接着就是其$this->callback
参数:
public function __construct(callable $callback, Request $request)
{
$this->request = $request;
$this->callback = $callback;
}
然后其实是在AuthManager.php
中初始化RequestGuard
类:
public