bigIncrements('id'); $table->timestamps(); $table->string('name',50)->unique()->comment('名称'); }); for ($i=0;$iunits);$i++){ DB::insert(DB::raw("INSERT INTO units(name,created_at,updated_at) VALUES(?,?,?)"),[ $this->units[$i],date("Y-m-d"),date("Y-m-d") ]); } } /** * Reverse the migrations. * * @return void */ public function down() { Schema::dropIfExists('units'); } }