chrisreedio/laravel-scout-keys
最新稳定版本:v1.0.0-beta.6
Composer 安装命令:
composer require chrisreedio/laravel-scout-keys
包简介
Provides user level tenant tokens / scoped search keys.
README 文档
README
This package provides user level tenant tokens / scoped search keys for Laravel Scout.
The current implementation supports the Meilisearch and Typesense drivers.
TODO
- Add support for runtime configuration of generated key facets/filtered attributes
Installation
You can install the package via composer:
composer require chrisreedio/laravel-scout-keys
You can publish and run the migrations with:
php artisan vendor:publish --tag="laravel-scout-keys-migrations"
php artisan migrate
You can publish the config file with:
php artisan vendor:publish --tag="laravel-scout-keys-config"
This is the contents of the published config file:
return [ /** * Whether to register the Scout Indexing commands for use via web. */ 'register_commands' => false, 'key' => [ /** * The number of minutes a search key should be valid for. */ 'lifetime' => env('SCOUT_KEY_EXPIRATION', 60 * 12), ], ];
Usage
Add the SearchUser interface and HasSearchKeys trait to your User model(s).
Example:
class User extends Authenticatable SearchUser { use HasFactory, HasSearchKeys; // ... }
Finally, add the following to your web.php routes file:
ScoutKeys::getRoute();
If you'd like to change the default path of /search/key, you may pass the desired path as the first argument to the getRoute method.
ScoutKeys::getRoute('dashboard/search/key');
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.
统计信息
- 总下载量: 44
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 1
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-09-17