mirror of
https://github.com/stancl/tenancy-docs.git
synced 2025-12-12 02:04:03 +00:00
Update data prefix (#181)
`data.` is not working for me as a prefix. I had to use `data->`. This is consistent with the Laravel docs. Not sure if I'm missing something? https://laravel.com/docs/9.x/queries#json-where-clauses
This commit is contained in:
parent
d67116163d
commit
53f9125946
1 changed files with 2 additions and 2 deletions
|
|
@ -99,12 +99,12 @@ public static function getDataColumn(): string
|
|||
|
||||
Note that querying data inside the `data` column with `where()` will require that you do for example:
|
||||
```php
|
||||
where('data.foo', 'bar')
|
||||
where('data->foo', 'bar')
|
||||
```
|
||||
|
||||
The data column is encoded/decoded only on model retrieval and saving.
|
||||
|
||||
Also a good rule of thumb is that when you need to query the data with `WHERE` clauses, it should have a dedicated column. This will improve performance and you won't have to think about the `data.` prefixing.
|
||||
Also a good rule of thumb is that when you need to query the data with `WHERE` clauses, it should have a dedicated column. This will improve performance and you won't have to think about the `data->` prefixing.
|
||||
|
||||
## Running commands in the tenant context {#running-commands-in-the-tenant-context}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue