mirror of
https://github.com/stancl/tenancy-docs.git
synced 2025-12-12 10:14:03 +00:00
Old todo
This commit is contained in:
parent
141b9fdbc2
commit
e130cd9596
1 changed files with 1 additions and 3 deletions
|
|
@ -110,8 +110,6 @@ and this on **secondary models:**
|
|||
$table->unique(['post_id', 'user_id']);
|
||||
```
|
||||
|
||||
TODO: Unique constraints, validation, mention that eloquent models will be scoped, but DB calls won't
|
||||
|
||||
### Validation {#validations}
|
||||
|
||||
The `unique` and `exists` validation rules of course aren't scoped to the current tenant, so you need to scope them manually like this:
|
||||
|
|
@ -158,4 +156,4 @@ use Stancl\Tenancy\Database\Concerns\BelongsToTenant;
|
|||
BelongsToTenant::$tenantIdColumn = 'team_id';
|
||||
```
|
||||
|
||||
Note that this is universal to all your primary models, so if you use `team_id` somewhere, you use it everywhere — you can't use both `team_id` and `tenant_id`.
|
||||
Note that this is universal to all your primary models, so if you use `team_id` somewhere, you use it everywhere — you can't use both `team_id` and `tenant_id`.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue