after I've manually deleted a table in mysql, I run the command:
php artisan migrate
and I get this:
Nothing to migrate.
it only works the first time, how to re-run the migration in laravel?
Manually delete the migration file under app/database/migrations/my_migration_file_name. php. Reset the composer autoload files: composer dump-autoload. Modify your database: Remove the last entry from the migrations table.
Laravel keeps a record of migrations that have been run. You need to go to the migrations table and delete the migration record. Laravel does this so that it knows which migrations have been run so that it doesn't run them again and so that in the case of a rollback, it knows the last batch of migrations which were done.
This may help https://laravel.com/docs/5.6/migrations
Try composer dump-autoload
AND php artisan config:cache
if not working also Try php artisan migrate:refresh
.
OR Also Delete Migration table in database.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With