简体   繁体   English

Laravel Messenger-传递给Illuminate \\ Auth \\ Guard :: login()的参数1必须实现Illuminate \\ Contracts \\ Auth \\ Authenticatable接口,给定null

[英]Laravel messenger - Argument 1 passed to Illuminate\Auth\Guard::login() must implement interface Illuminate\Contracts\Auth\Authenticatable, null given

I am building a social networking site, and need a messaging system so I am using this , as it looks pretty good. 我正在建立一个社交网站,并且需要一个消息传递系统,因此我正在使用this ,因为它看起来不错。

I have set up Laravel and I am about half way through my project. 我已经建立了Laravel,并且大约完成了我的项目的一半。 I have added in laravel-messenger but as soon as I run it I get the following error: 我已经添加了laravel-messenger,但是一旦运行它,我就会收到以下错误:

Argument 1 passed to Illuminate\\Auth\\Guard::login() must implement interface Illuminate\\Contracts\\Auth\\Authenticatable, null given. 传递给Illuminate \\ Auth \\ Guard :: login()的参数1必须实现Illuminate \\ Contracts \\ Auth \\ Authenticatable接口,给定null。

I have Googled and researched but I haven't found a clear solution, I need help! 我已经过Google搜索和研究,但没有找到明确的解决方案,我需要帮助!

Your User model should be like this (should implement these and use proper traits) 您的用户模型应该是这样的(应该实现这些并使用适当的特征)

use Illuminate\Auth\Authenticatable;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Auth\Passwords\CanResetPassword;
use Illuminate\Foundation\Auth\Access\Authorizable;
use Illuminate\Contracts\Auth\Authenticatable as AuthenticatableContract;
use Illuminate\Contracts\Auth\Access\Authorizable as AuthorizableContract;
use Illuminate\Contracts\Auth\CanResetPassword as CanResetPasswordContract;

class User extends Model implements AuthenticatableContract,
                                AuthorizableContract,
                                CanResetPasswordContract
{
    use Authenticatable, Authorizable, CanResetPassword;
    //enter code here
}

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 社交名流:传递给 Illuminate\Auth\SessionGuard::login() 的参数 1 必须实现接口 Illuminate\Contracts\Auth\Authenticatable,给定 null - Socialite : Argument 1 passed to Illuminate\Auth\SessionGuard::login() must implement interface Illuminate\Contracts\Auth\Authenticatable, null given LARAVEL 7.0 传递给 Illuminate\\Auth\\SessionGuard::login() 的参数 1 必须实现接口 Illuminate\\Contracts\\Auth\\Authenticatable,给定数组 - LARAVEL 7.0 Argument 1 passed to Illuminate\Auth\SessionGuard::login() must implement interface Illuminate\Contracts\Auth\Authenticatable, array given 传递给 Illuminate\Auth\EloquentUserProvider::validateCredentials() 的参数 1 必须是 Illuminate\Contracts\Auth\Authenticatable 的实例 - Argument 1 passed to Illuminate\Auth\EloquentUserProvider::validateCredentials() must be an instance of Illuminate\Contracts\Auth\Authenticatable 问题:参数 #1 ($user) 必须是 Illuminate\Contracts\Auth\Authenticatable 类型,null 给定,调用 - Issue: Argument #1 ($user) must be of type Illuminate\Contracts\Auth\Authenticatable, null given, called in TypeError: Illuminate\Auth\SessionGuard::login(): 参数 #1 ($user) 必须是类型 Illuminate\Contracts\Auth\Authenticatable,, App\Models\Admin giv - TypeError: Illuminate\Auth\SessionGuard::login(): Argument #1 ($user) must be of type Illuminate\Contracts\Auth\Authenticatable,, App\Models\Admin giv 传递给 Arubaao\\BasicAuth\\BasicGuard::__construct() 的参数 2 必须是 Illuminate\\Contracts\\Auth\\UserProvider 的实例,给定 null - Argument 2 passed to Arubacao\BasicAuth\BasicGuard::__construct() must be an instance of Illuminate\Contracts\Auth\UserProvider, null given 不能使用 Illuminate\Contracts\Auth\Authenticatable - 这不是一个特征 - Cannot use Illuminate\Contracts\Auth\Authenticatable - it is not a trait 传递给SessionGuard :: login()的参数1必须是Laravel 5.2中Auth \\ Authenticatable的实例 - Argument 1 passed to SessionGuard::login() must be an instance of Auth\Authenticatable in Laravel 5.2 注册错误,参数1传递给laravel 5.8中的Illuminate \\ Auth \\ SessionGuard :: login() - Registration error, Argument 1 passed to Illuminate\Auth\SessionGuard::login() in laravel 5.8 Laravel致命错误:致命错误:找不到接口'Illuminate \\ Auth \\ Illuminate \\ Contracts \\ Auth \\ Factory' - Laravel fatal error: Fatal error: Interface 'Illuminate\Auth\Illuminate\Contracts\Auth\Factory' not found
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM