Skip to content

Commit

Permalink
Move note about statelessness
Browse files Browse the repository at this point in the history
  • Loading branch information
Caleb Fidecaro committed Sep 13, 2016
1 parent dcd40fa commit f27cea2
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@ For example, you might have a `companies` table, and a bunch of other tables tha

### Adding and Removing Tenants

> **IMPORTANT NOTE:** Landlord is stateless. This means that when you call `addTenant()`, it will only scope the *current request*.
>
> Make sure that you are adding your tenants in such a way that it happens on every request, and before you need Models scoped, like in a middleware or as part of a stateless authentication method like OAuth.
You can tell Landlord to automatically scope by a given Tenant by calling `addTenant()`, either from the `Landlord` facade, or by injecting an instance of `TenantManager()`.

You can pass in either a tenant column and id:
Expand Down Expand Up @@ -108,10 +112,6 @@ And if for some reason you need to, you can retrieve Landlord's tenants:
$tenants = Landlord::getTenants();
```

> **IMPORTANT NOTE:** Landlord is stateless. This means that when you call `addTenant()`, it will only scope the *current request*.
>
> Make sure that you are adding your tenants in such a way that it happens on every request, and before you need Models scoped, like in a middleware or as part of a stateless authentication method like OAuth.
### Setting up your Models

To set up a model to be scoped automatically, simply use the `BelongsToTenants` trait:
Expand Down

0 comments on commit f27cea2

Please sign in to comment.