【发布时间】:2019-04-14 19:31:23
【问题描述】:
我尝试为状态设置布尔值,但我发现“状态”列不能为空。我该怎么办?下面是我为创建用户表设置的代码。
public function up()
{
Schema::create('users', function (Blueprint $table) {
$table->increments('id');
$table->string('name');
$table->string('email')->unique();
$table->string('password');
$table->string('role')->nullable();
$table->boolean('status');
$table->string('address')->nullable();
$table->string('city')->nullable();
$table->string('postal_code')->nullable();
$table->string('phone')->nullable();
$table->rememberToken();
$table->timestamps();
});
}
【问题讨论】: