You can install the package via composer:
composer require therecluse26/laravel-scout-tools
You can publish all custom resources with:
php artisan vendor:publish --provider="TheRecluse26\ScoutTools\ScoutToolsServiceProvider"
php artisan migrate
This will generate a migration file and a config/scout-tools.php
file with the following contents:
(This config can be individually be generated using php artisan vendor:publish --tag="scout-tools-config"
)
return [
'driver' => env('SCOUT_DRIVER'),
'routes' => [
'middleware' => ['auth:api'],
'endpoints' => [
'get-models' => ['path' => '/scout/models'],
'refresh-models' => ['path' => '/scout/models/refresh'],
'index-detail' => ['path' => '/scout/index/{scout_model}'],
],
],
];
This can be modified to specify custom route paths well as which middleware(s) to apply to the route group
Optionally, you can publish Vue templates to /resources/assets/js/scout-tools
using
php artisan vendor:publish --tag="scout-tools-vue"
You can also publish Blade components using (these will be published to app/View/Components/Scout
)
php artisan scout-tools:install-view ScoutModelTable
php artisan scout-tools:install-view ScoutModelTableRow
This package provides some useful functionality missing from the base Laravel Scout package
This package exposes a php artisan scout:sync
command that can be used to automatically detect all project models with
the Scout Searchable
trait and synchronize their data with the configured Scout service.
Passing a --flush
or -F
flag to this command will clear the Scout index data and re-sync it all from scratch.
composer test
Please see CHANGELOG for more information on what has changed recently.
Please see CONTRIBUTING for details.
Please review our security policy on how to report security vulnerabilities.
The MIT License (MIT). Please see License File for more information.