定制 bytexr/laravel-pennant-launchdarkly 二次开发

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

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

bytexr/laravel-pennant-launchdarkly

最新稳定版本:v2.0.4

Composer 安装命令:

composer require bytexr/laravel-pennant-launchdarkly

包简介

Laravel Pennant LaunchDarkly Driver

README 文档

README

Total Downloads Latest Stable Version License

Introduction

Laravel Pennant LaunchDarkly simplifies the integration of Laravel Pennant with LaunchDarkly, offering a seamless experience.

Installation

composer require bytexr/laravel-pennant-launchdarkly

To make the necessary updates, navigate to config/services.php and add the following code:

return [
    ...

    'launch-darkly' => [
        'key'     => env('LAUNCH_DARKLY_KEY'),
        'dynamodb'     => [
            'table' => env('LAUNCH_DARKLY_DYNAMODB_TABLE')
        ],
        'options' => [],
    ]

];

If already haven't, publish Laravel Pennant config and add store to the config file in config/pennant.php:

    'stores' => [
        ...

        'launch-darkly' => [
            'driver' => 'launch-darkly'
        ]

    ]

Ensure that all required environment variables are set in your .env file, and don't forget to set the PENNANT_STORE value to launch-darkly.

Extends User model and all other scopes used in Pennant with HasLaunchDarklyContext interface and implement methods:

class User extends Authenticatable implements HasLaunchDarklyContext
{
    ...
    
    public function getLaunchDarklyContext(): LDContext|LDUser
    {
        return (new LDUserBuilder($this->getKey()))
            ->email($this->email)
            ->build();
    }
    
    // OR if you would like to use context instead

    public function getLaunchDarklyContext(): LDContext|LDUser
    {
        return LDContext::builder('user')
                        ->set('email', $this->email)
                        ->build();
    }
}

License

Laravel Pennant LaunchDarkly is open-sourced software licensed under the MIT license.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-08-22