chrisreedio/laravel-scout-keys 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱: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.

统计信息

  • 总下载量: 51
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 1
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

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

其他信息

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

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固