承接 chrisreedio/laravel-scout-keys 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

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

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

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-09-17