![]() In light of this, Pennant allows you to format scope values for storage by implementing the FeatureScopeable contract on the objects in your application that are used as Pennant scopes.įor example, imagine you are using two different feature drivers in a single application: the built-in database driver and a third-party "Flag Rocket" driver. However, if your application utilizes a third-party Pennant driver, that driver may not know how to properly store an identifier for an Eloquent model or other custom types in your application. Pennant's built-in array and database storage drivers know how to properly store scope identifiers for all PHP data types as well as Eloquent models. In this example, we will define a feature for incrementally rolling out a new API to our application's users: Most commonly, the scope is the currently authenticated user. The closure will receive the "scope" for the feature check. Typically, features are defined in a service provider using the Feature facade. You will need to provide a name for the feature, as well as a closure that will be invoked to resolve the feature's initial value. To define a feature, you may use the define method offered by the Feature facade. Or, Pennant can store resolved feature flag values persistently in a relational database via the database driver, which is the default storage mechanism used by Pennant. Pennant includes support for storing resolved feature flag values in an in-memory array via the array driver. ![]() This configuration file allows you to specify the default storage mechanism that will be used by Pennant to store resolved feature flag values. ![]() After publishing Pennant's assets, its configuration file will be located at config/pennant.php.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |