mirror of
https://github.com/stancl/tenancy-docs.git
synced 2025-12-12 10:14:03 +00:00
3.x redesign
This commit is contained in:
parent
857122540f
commit
f8f354c323
229 changed files with 201175 additions and 22440 deletions
30
source/docs/v2/tenant-migrations.blade.md
Normal file
30
source/docs/v2/tenant-migrations.blade.md
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
---
|
||||
title: Tenant Migrations
|
||||
description: Tenant Migrations
|
||||
extends: _layouts.documentation
|
||||
section: content
|
||||
---
|
||||
|
||||
# Tenant Migrations {#tenant-migrations}
|
||||
|
||||
You can run tenant migrations using the `php artisan tenants:migrate` command.
|
||||
|
||||
You may specify the tenant(s) using the `--tenants` option.
|
||||
|
||||
```
|
||||
php artisan tenants:migrate --tenants=8075a580-1cb8-11e9-8822-49c5d8f8ff23
|
||||
```
|
||||
|
||||
> Note: Tenant migrations must be located in `database/migrations/tenant`.
|
||||
|
||||
You can run migrations from outside the command line as well. To run migrations for a tenant in your code, use `Artisan::call()`:
|
||||
|
||||
```php
|
||||
$tenant = \Tenant::create('tenant1.localhost');
|
||||
|
||||
\Artisan::call('tenants:migrate', [
|
||||
'--tenants' => [$tenant->id];
|
||||
]);
|
||||
```
|
||||
|
||||
You may also [configure]({{ $page->link('configuration#migrate-after-creation') }}) the package to run migrations automatically, after creating tenants.
|
||||
Loading…
Add table
Add a link
Reference in a new issue