-
创建迁移
public function up() { Schema::create('users', function (Blueprint $table) { $table->increments('id'); $table->string('account'); $table->string('password'); $table->char('phone',11)->unique(); $table->string('email')->unique(); $table->timestamp('email_verified_at')->nullable(); $table->tinyInteger('user_status')->default(1); $table->tinyInteger('user_type')->default(1); $table->rememberToken(); $table->timestamps(); }); } -
填充数据
User::factory()->create([ 'account'=>'xbvan', 'password'=>Hash::make('123456'), 'phone'=>'13800168222', 'email'=>'xbvan@163.com' ]); - 报错
为什么会报没有字段 name 这个问题,定义的 users 表并没有 name 字段
0 Commentaires