pennant
pennant copied to clipboard
A simple, lightweight library for managing feature flags.
fixes #101
Database driver does not work at scale, we have thousand of `SQLSTATE[23505]: Unique violation: 7 ERROR: duplicate key value violates unique constraint "features_name_scope_unique"` because of the driver architecture when you...
fixes #101 ## Problem Laravel Pennant implements a unique constraint that can cause race conditions: https://github.com/laravel/pennant/blob/83178d76f41d45276da9ce37cf7d76c9f5b28945/database/migrations/2022_11_01_000001_create_features_table.php#L23 The race condition can be illustrated with the following application setup: ```sh echo "Create...
I want to be able to check if any of a user's related models have a particular feature enabled. ```php $schools = $user->loadMissing('schools'); $featureIsActive = Feature::for($schools)->someAreActive('enrolled-in-beta'); ``` But this actually...
My project requires scoping features across multiple different models. Quick example: ``` Feature::define('beta-design', function(Team $team)...) Feature::define('password', function(User $user)...) ``` When I configure this a Service provider, all calls to `all()`...
Adds a new `activeOrFail` (taking the naming convention from Eloquent models) method to check if a feature is active, throwing an exception if it isn’t. The motivation for this method...
[1.x] Allow retrieving all features for a scope when some features are defined for differing scopes
This should resolve https://github.com/laravel/pennant/issues/112 We are building a feature flags endpoint for our mobile and web consumers. We need to be able to get all features for 3-4 scopes which...