@@ -35,6 +35,7 @@ A simple feature toggle api for Laravel applications.
3535 - [ QueryString Toggle Provider] ( #querystring-toggle-provider )
3636 - [ Configure Query String Keys] ( #configure-query-string-keys )
3737 - [ Add Api Key Authorization] ( #add-api-key-authorization )
38+ - [ Redis Toggle Provider] ( #redis-toggle-provider )
3839- [ Frontend Feature Toggle Api] ( #frontend-feature-toggle-api )
3940- [ Road Map] ( #road-map )
4041
@@ -115,7 +116,7 @@ Or you can use the normal `@if` blade directive and call `feature_toggle` functi
115116@endif
116117// OR
117118@if(feature_toggle('Example', 'off'))
118- // do soemthing
119+ // do something
119120@endif
120121```
121122
@@ -207,6 +208,7 @@ The default feature toggle providers are as follows:
207208- ` eloquent `
208209- ` local ` (config)
209210- ` querystring `
211+ - ` redis `
210212
211213You can access these directly via:
212214``` php
@@ -420,12 +422,38 @@ may configure the driver with a `token`/api key. By default the query string inp
420422 [
421423 'driver' => 'querystring',
422424 'apiKey' => env('FEATURE_TOGGLE_API_KEY'),
423- // Optionally change to sometihing different than 'feature_token' .
425+ // Optionally change to something different.
424426 // 'apiInputKey' => 'feature_toggle_api_token',
425427 ],
426428],
427429```
428430
431+ ### Redis Toggle Provider
432+ To use the ` redis ` driver you will need to update the ` feature-toggle ` config/` setProviders ` method call,
433+ place the following within the ` providers ` key:
434+ ``` php
435+ 'providers' => [
436+ [
437+ 'driver' => 'redis',
438+ ],
439+ ],
440+ ```
441+
442+ There are three options that can be configured:
443+ - ` key ` , defaults to ` feature_toggles `
444+ - ` prefix ` , defaults to ` null `
445+ - ` connection ` , defaults to ` default `
446+ ``` php
447+ 'providers' => [
448+ [
449+ 'driver' => 'querystring',
450+ 'key' => 'toggles', // Optional, otherwise 'feature_toggles'
451+ 'prefix' => 'feature', // Optional
452+ 'connection' => 'toggles', // Must match key in database.redis.{connection}
453+ ],
454+ ],
455+ ```
456+
429457## Frontend Feature Toggle Api
430458Place the following in your main layout blade template in the ` <head> ` tag.
431459``` blade
@@ -501,4 +529,6 @@ class App extends Component {
501529 - [x] Blade
502530 - [x] Middleware
503531 - [x] Validation
532+ - [ ] Create/update toggles via common contract interface.
533+ - [ ] Create Command to create/update toggles to be active/inactive.
504534- [ ] Classmap Feature Toggles (FeatureToggleServiceProvider similar to AuthServiceProvider $policies).
0 commit comments