Skip to content

Commit

Permalink
Merge pull request #14 from spatie/MichaelHappelOlsen-patch-1
Browse files Browse the repository at this point in the history
Update using-multiple-databases.md
  • Loading branch information
freekmurze authored May 19, 2020
2 parents e948f45 + c7f72ca commit ae066f5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions docs/installation/using-multiple-databases.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ If you also want to seed tenant database you can execute this command:
php artisan tenants:artisan "migrate --seed"
```

This will cause all seeders to run. In your `DatabaseSeeder` you can use `Tenant::check()` to verify if the seeding is done for a tenant or a landlord.
This will cause all seeders to run. In your `DatabaseSeeder` you can use `Tenant::checkCurrent()` to verify if the seeding is done for a tenant or a landlord.

```php
use Illuminate\Database\Seeder;use Spatie\Multitenancy\Models\Tenant;
Expand All @@ -109,12 +109,12 @@ class DatabaseSeeder extends Seeder
{
public function run()
{
Tenant::check()
Tenant::checkCurrent()
? $this->runTenantSpecificSeeders()
: $this->runLandlordSpecificSeeders()
}

public function runTenantSeeders()
public function runTenantSpecificSeeders()
{
// run tenant specific seeders
}
Expand Down

0 comments on commit ae066f5

Please sign in to comment.