Using a single database

Before using the following instructions, make sure you have performed the base installation steps first.

Only use the instructions on this page if you want use one database.

Migrating the database

With the database connection set up we can migrate the landlord database.

First, you must publish and run the migration:

php artisan vendor:publish --provider="Spatie\Multitenancy\MultitenancyServiceProvider" --tag="migrations"
php artisan migrate

This will create the tenants table which holds configuration per tenant.

Next steps

When using multiple tenants, you probably want to isolate the cache or use separate filesystems per tenant, … These things are perform by task classes that will be executed when making a tenant the current one.

The package can also has an option to make the queue tenant aware.