Migrations

A migration is a PHP file that describes a change to the database schema: table creation, adding a column, an index. Migrations are versioned with the code and applied in order with php artisan migrate. Each defines up and down so it can be undone.

Example

Schema::create('produits', function (Blueprint $t) {
  $t->id();
  $t->string('nom');
  $t->timestamps();
});

Related concepts

The whole glossary