
Laravel migrate model using artisan
Posted under » Laravel on 16 June 2026
php artisan migrate
The command php artisan migrate is a built-in Laravel Artisan command that executes all pending database migrations. It functions as a type of version control for your database,
updating your database schema based on the PHP files located in your database/migrations directory. It will
- Tracking changes: When run for the first time, Laravel automatically creates a special migrations table in your database.
- Executing pending files: Every time you run the command, Laravel checks this table to see which migration files have already been executed. It then runs only the new or outstanding files.
- Idempotency: If your database is already perfectly up to date, running it again will safely output "Nothing to migrate"
Depending on your workflow, you might need variations of the migration command:
- php artisan migrate:status – Displays a table showing which migrations have run and which ones are pending.
- php artisan migrate:rollback – Reverts the last batch of migrations that were run.
- php artisan migrate:reset – Rolls back all migrations, leaving your database completely empty.
- php artisan migrate:refresh – Rolls back all migrations and then runs them from the beginning.
- php artisan migrate:fresh – Drops all tables entirely and runs all migrations from scratch (faster than refresh).
For Django migrate.