mirror of
https://github.com/stancl/tenancy-docs.git
synced 2025-12-12 18:24:03 +00:00
Update tenants.blade.md
This commit is contained in:
parent
07584b88f7
commit
ddff134223
1 changed files with 3 additions and 3 deletions
|
|
@ -137,10 +137,10 @@ When your code executes in the context of a tenant, you may access the central a
|
|||
For instance, if you want to retrieve the list of users of the central application when the code executes in a tenant's context, you may write:
|
||||
|
||||
```php
|
||||
// here we are in the tenant's context. \App\Models\User::all() would return the current tenant's users.
|
||||
// Here we are in the tenant's context. User::all() would return the current tenant's users
|
||||
$centralUsers = tenancy()->central(function () {
|
||||
// here we are in the central app context
|
||||
return \App\Models\User::all();
|
||||
// Here we are in the central context
|
||||
return User::all();
|
||||
});
|
||||
```
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue