Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

delete rows by migration laravel

Comment::where('post_id',$id)->delete();

// in down migration

    public function down()
    {
        Schema::table('package_types', function (Blueprint $table) {
            AppModelsPackageType::query()->where('id','gt',1)->delete();
        });
    }
Source by www.pakainfo.com #
 
PREVIOUS NEXT
Tagged: #delete #rows #migration #laravel
ADD COMMENT
Topic
Name
1+7 =