therecluse26 / laravel-scout-tools
Tools and enhancements for Laravel Scout
Installs: 7 374
Dependents: 0
Suggesters: 0
Security: 0
Stars: 4
Watchers: 3
Forks: 0
Open Issues: 2
Requires
- php: ^8.0|^8.1
- haydenpierce/class-finder: ^0.4.3
- illuminate/contracts: >=8.0
- laravel/scout: *
- spatie/laravel-package-tools: ^1.9.2
Requires (Dev)
- nunomaduro/collision: ^6.0
- nunomaduro/larastan: ^2.0.1
- orchestra/testbench: ^7.0
- pestphp/pest: ^1.21
- pestphp/pest-plugin-laravel: ^1.1
- phpstan/extension-installer: ^1.1
- phpstan/phpstan-deprecation-rules: ^1.0
- phpstan/phpstan-phpunit: ^1.0
- phpunit/phpunit: ^9.5
This package is auto-updated.
Last update: 2024-04-04 00:54:13 UTC
README
Installation
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
Views
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
Usage
This package provides some useful functionality missing from the base Laravel Scout package
Artisan Commands
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.
Testing
composer test
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
License
The MIT License (MIT). Please see License File for more information.