定制 therecluse26/laravel-scout-tools 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

therecluse26/laravel-scout-tools

Composer 安装命令:

composer require therecluse26/laravel-scout-tools

包简介

Tools and enhancements for Laravel Scout

README 文档

README

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

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.

统计信息

  • 总下载量: 7.37k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 4
  • 点击次数: 3
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 4
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-08-20