-
Notifications
You must be signed in to change notification settings - Fork 49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[1.x] Introduce before hook #111
Conversation
$features = Collection::make($features) | ||
$resolved = Collection::make($features) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Noticed a potential bug with the reassignment of this argument. Renaming to avoid issues.
ae01453
to
9529b8e
Compare
phpunit.xml.dist
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Migrated to the latest config here. running the testsuite was yelling at me that the config was out of date.
This feels like a better and more laravely solution than #110. I love it. |
Just a quick hint: The link of this repository does not point to the current docs (it's linking to 10.x). |
Updated that. Thanks for the heads up. |
replaces #110
This PR introduces a "before" hook to class based features that allows you to intercept feature resolution before hitting the storage driver.
When a non-null value is returned from the before hook, it is used in place of retrieving the value from storage. Values returned from the before hook are never persisted to storage and are only ever used in-memory.
This allows you to:
Example: Schedule the initial feature rollout after a given date
Example: Roll the feature out to everyone after a given date.
Example: provide a non-destructive killswitch
Example: composing different usecases