tenancy-docs/source/docs/v3/integrations/scout.blade.md
2022-09-08 10:14:51 +02:00

803 B

title extends section
Laravel Scout integration _layouts.documentation content

Laravel Scout

Note: Make sure the Scout config file is published

After installing Scout, add ScoutTenancyBootstrapper to the bootstrappers in your Tenancy config (config/tenancy.php):

'bootstrappers' => [
    ...
    Stancl\Tenancy\Bootstrappers\Integrations\ScoutTenancyBootstrapper::class,
],

This makes 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 import your existing records for each tenant using the tenants:run command:

php artisan tenants:run scout:import --argument="model=App\Models\YourSearchableModel"