无法让 authorization.basic 在 laravel 5.2.7 中工作

Could not get authorization.basic working in laravel 5.2.7

我在调用身份验证时遇到以下错误

Type error: Argument 1 passed to Illuminate\Auth\EloquentUserProvider::validateCredentials() must be an instance of Illuminate\Contracts\Auth\Authenticatable, instance of App\User given,

您应该确保,您 User class 扩展了 Illuminate\Foundation\Auth\User Laravel 5.2 中的默认值。此 class 实现 Illuminate\Contracts\Auth\Authenticatable 并且此合约在函数 validateCredentials:

中是必需的

Laravel 5.2 的默认用户 class 可在此处找到:https://github.com/laravel/laravel/blob/master/app/User.php