mirror of
https://github.com/stancl/tenancy-docs.git
synced 2025-12-12 02:04:03 +00:00
Add note instructing to make sure the Scout config file is published
This commit is contained in:
parent
228aad6751
commit
225b22c03e
1 changed files with 3 additions and 1 deletions
|
|
@ -5,7 +5,9 @@ section: content
|
|||
---
|
||||
|
||||
# Laravel Scout {#laravel-scout}
|
||||
After [installing Scout](https://laravel.com/docs/9.x/scout#installation), make sure the models of all tenants aren't being imported in the same index by prefixing the model indices with the current tenant's key. You can achieve that by adding a listener with this code to the TenancyInitialized event in your TenancyServiceProvider:
|
||||
> Note: Make sure the Scout config file is published
|
||||
|
||||
After [installing Scout](https://laravel.com/docs/9.x/scout#installation), make sure the models of all tenants aren't being imported in the same index by prefixing the model indices with the current tenant's key. You can achieve that by adding a listener with this code to the `TenancyInitialized` event in your `TenancyServiceProvider`:
|
||||
|
||||
```php
|
||||
config(['scout.prefix' => tenant()->getTenantKey()]);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue