Answers for "how to reset one specific table with migration in laravel"

PHP
1

refresh a specific migration laravel

php artisan migrate --path=/database/migrations/selected/
Posted by: Guest on April-24-2021
0

delete rows by migration laravel

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();
        });
    }
Posted by: Guest on August-14-2021

Code answers related to "how to reset one specific table with migration in laravel"

Browse Popular Code Answers by Language