📜  laravel 删除表迁移 - PHP 代码示例

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

代码示例6
Comment::where('post_id',$id)->delete();

// in down migration

    public function down()
    {
        Schema::table('package_types', function (Blueprint $table) {
            \App\Models\PackageType::query()->where('id','gt',1)->delete();
        });
    }