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

  1. Tracking changes: When run for the first time, Laravel automatically creates a special migrations table in your database.
  2. 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.
  3. 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:

  1. php artisan migrate:status – Displays a table showing which migrations have run and which ones are pending.
  2. php artisan migrate:rollback – Reverts the last batch of migrations that were run.
  3. php artisan migrate:reset – Rolls back all migrations, leaving your database completely empty.
  4. php artisan migrate:refresh – Rolls back all migrations and then runs them from the beginning.
  5. php artisan migrate:fresh – Drops all tables entirely and runs all migrations from scratch (faster than refresh).

For Django migrate.

web security linux ubuntu Raspberry   git   javascript python django Laravel drupal php apache mysql  MongoDB AWS data  ML AI