# Migrations

# Create a migration

php artisan make:migration create_products_table

# Commands

# fresh

Drop all tables and re-run all migrations

php artisan migrate:fresh

# install

Create the migration repository

php artisan migrate:install

# refresh

Reset and re-run all migrations

php artisan migrate:refresh

# reset

Rollback all database migrations

php artisan migrate:reset

# rollback

Rollback the last database migration

php artisan make:migration rollback

# Migration failure events

Laravel 13.42 adds MigrationFailed, which fires when a migration throws. It exposes the same migration, method, and name properties as the other migration events, plus exception. The exception is still thrown after the event fires.[1][2]

use Illuminate\Database\Events\MigrationFailed;
use Illuminate\Support\Facades\Artisan;
use Illuminate\Support\Facades\Event;
use Illuminate\Support\Facades\Log;

Event::listen(function (MigrationFailed $event): void {
    Artisan::call('down');

    Log::channel('slack')->critical("Migration [{$event->name}] failed", [
        'exception' => $event->exception->getMessage(),
    ]);
});

On MySQL, schema changes such as ALTER TABLE are not rolled back when a later statement in the migration fails. Use the event to alert the team or take the application down before users reach the half-applied schema.[1]

# status

Show the status of each migration

php artisan migrate:status

# Sources

Last Updated: 11/11/2026, 23:19:22