Answers for "run migrate wihout delete data laravel"

PHP
0

re migrate laravel

Try:
composer dump-autoload
php artisan config:cache

If not working also try:
php artisan migrate:refresh.
Posted by: Guest on July-02-2020
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

Browse Popular Code Answers by Language