These docs are for v2.0. Click to read the latest docs for v5.

Tenant migrations & seeds

How to run migrations for specific or all tenants.

If you run the artisan command with either help migrate or help seed you will find that you can easily select a tenant to run migrations or seeds for:

The tenant(s) to apply on; use {all|5,8}

If you leave out the option migration and seeds are being run on the default connection.

Running a migration for a tenant

In order to run a migration for one specific tenant, let's say tenant Id 1, you can run the following migrate command.

php artisan migrate --tenant=1

Running a seed for a tenant

The same way works for seeding only in the tenant Id 1 website.

php artisan db:seed --tenant=1

Running a migration with a seeder for a tenant

The same way works for migrating and seeding only in the tenant Id 1 website.

php artisan migrate --seed --tenant=1