generated from worksome/package-skeleton-laravel
-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfeature-flags.php
76 lines (67 loc) · 2.3 KB
/
feature-flags.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
<?php
declare(strict_types=1);
use Worksome\FeatureFlags\ModelFeatureFlagConvertor;
// config for Worksome/FeatureFlags
return [
'default' => env('FEATURE_FLAGS_PROVIDER', 'launchdarkly'),
/**
* Convertor implementing FeatureFlagUserConvertor contract
*/
'convertor' => ModelFeatureFlagConvertor::class,
/**
* Overrides implementing FeatureFlagOverrider contract
*/
'overrider' => 'config',
'providers' => [
'bucket' => [
'key' => env('BUCKET_SECRET_KEY'),
'host' => env('BUCKET_HOST', 'https://front-eu.bucket.co'),
'options' => [],
],
'launchdarkly' => [
'key' => env('LAUNCHDARKLY_SDK_KEY'),
'options' => [
/**
* https://docs.launchdarkly.com/sdk/features/offline-mode
*/
'offline' => env('LAUNCHDARKLY_OFFLINE', false),
],
/**
* @link https://docs.launchdarkly.com/home/account-security/api-access-tokens
*/
'access-token' => env('FEATURE_FLAGS_API_ACCESS_TOKEN', null),
],
],
/**
* List of available overriders.
* Key is to be used to specify which overrider should be active.
*/
'overriders' => [
'config' => [
/**
* Overrides all feature flags directly without hitting the provider.
* This is particularly useful for running things in the CI,
* e.g. Cypress tests.
*
* Be careful in setting a default value as said value will be applied to all flags.
* Use `null` value if needing the key to be present but act as if it was not
*/
'override-all' => null,
/**
* Override flags. If a feature flag is set inside an override,
* it will be used instead of the flag set in the provider.
*
* Usage: ['feature-flag-key' => true]
*
* Be careful in setting a default value as it will be applied.
* Use `null` value if needing the key to be present but act as if it was not
*/
'overrides' => [
// ...
],
],
'in-memory' => [
// ...
],
],
];