GuardHelpers 不与 customGuard 一起工作

GuardHelpers not working with customGuard

我做了以下自定义守卫:

<?php
namespace App\Auth;

use Illuminate\Http\Request;
use Illuminate\Auth\GuardHelpers;
use Illuminate\Contracts\Auth\Guard;

class LicenseGuard implements Guard
{
    use GuardHelpers;

    protected $request;

    public function __construct(LicenseUserProvider $provider, Request $request)
    {
        $this->provider = $provider;
        $this->request  = $request;
    }

    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;

        $user       = null;
        $licenseKey = $this->request->json('license_key');

        if (!empty($licenseKey)) {
            $user = $this->provider->retrieveByLicense($licenseKey);
        }

        return $this->user = $user;
    }

    public function validate (Array $credentials = [])
    {
       /* Validate code */
    }
}
?>

在我的中间件中,我定义了以下内容:

<?php
if($this->auth->guard($guard)->quest())
    return response('You have entered an unknown license key', 401);

我得到的错误是:
致命错误:调用未定义的方法 App\Auth\LicenseGuard::quest()

我正在使用具有 "quest" 方法的默认 GuardHelper 特征,我只是无法找出为什么会这样。

我正在使用 PHP7 和 Lumen 5.2

不确定你在那里做什么我的朋友,但我假设 quest "isn't the droids you are looking for"。