Php 更改Laravel中的默认登录

Php 更改Laravel中的默认登录,php,laravel,Php,Laravel,我是Laravel和php的初学者。 我在我的项目中使用了Laravel 6 我有以下迁移: Schema::create('users', function (Blueprint $table) { $table->id(); $table->string('name'); $table->string('email')->unique(); $table->times

我是Laravel和php的初学者。 我在我的项目中使用了Laravel 6

我有以下迁移:

Schema::create('users', function (Blueprint $table) {
            $table->id();
            $table->string('name');
            $table->string('email')->unique();
            $table->timestamp('email_verified_at')->nullable();
            $table->string('password');
            $table->char('enable', 1)->default(0);
            $table->rememberToken();
            $table->timestamps();
        });
如何更改Laravel的默认登录名,使其允许启用=1(启用=0-我们不允许,类似于密码不正确的用户)的用户登录。

根据手动验证用户的说明,您可以使用此代码对启用了
字段设置为
true
的用户进行验证

$email=$request->input('email');
$password=$request->input('password');
如果(身份验证::尝试(['email'=>$email,'password'=>$password,'enabled'=>1])){
//用户处于活动状态,而不是挂起状态,并且已存在。
}

,在“指定附加条件”下。它不起作用。我想这是:-这段代码总是登录(当我启用=0或启用=1时)@traffske这可能是因为启用的类型是char,尝试将其更改为boolean或integer,看看是否有效。