📜  在迁移 laravel 中插入行 - PHP 代码示例

📅  最后修改于: 2022-03-11 14:54:40.997000             🧑  作者: Mango

代码示例1
public function up()
{
    // Create the table
    Schema::create('users', function($table){
        $table->increments('id');
        $table->string('email', 255);
        $table->string('password', 64);
        $table->boolean('verified');
        $table->string('token', 255);
        $table->timestamps();
    });

    // Insert some stuff
    DB::table('users')->insert(
        array(
            'email' => 'name@domain.com',
            'verified' => true
        )
    );
}