Refresh laravel migration for specific table

CairoCoder picture CairoCoder · Nov 8, 2017 · Viewed 13.1k times · Source

Can I run php artisan migrate:refresh for specific table? Or can I refresh specific table migration in general?

I tried this:

php artisan migrate --path=/database/migrations/selected/

But it's not working!

Answer

Yoss picture Yoss · May 4, 2019

You should add the path to your migration file to refresh just this table and run

php artisan migrate:refresh --path=/database/migrations/my_migration.php

if you need rollback:

php artisan migrate:rollback  --path=/database/migrations/my_migration.php