mirror of
https://github.com/stancl/tenancy-docs.git
synced 2025-12-12 10:14:03 +00:00
Attaching tenants to users
This commit is contained in:
parent
230fd6c971
commit
d3fcb69b5b
1 changed files with 1 additions and 1 deletions
|
|
@ -206,7 +206,7 @@ You can see that in the example above we're using the `TenantPivot` model for th
|
|||
```php
|
||||
$user = CentralUser::create(...);
|
||||
|
||||
$user->attach($tenant);
|
||||
$user->tenants()->attach($tenant);
|
||||
```
|
||||
|
||||
Attaching a tenant to a user will copy even the unsynced columns (they act as default values), similarly to how creating the user inside the tenant's database will copy the tenant to the central database 1:1.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue