PHPackages                             youcanshop/foggle - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. youcanshop/foggle

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

youcanshop/foggle
=================

A feature flagging package for Laravel.

v1.1.8(1y ago)36.6k↓34.1%MITPHPPHP &gt;=7.4

Since Mar 5Pushed 1y ago1 watchersCompare

[ Source](https://github.com/youcan-shop/foggle)[ Packagist](https://packagist.org/packages/youcanshop/foggle)[ RSS](/packages/youcanshop-foggle/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (6)Versions (13)Used By (0)

Foggle
======

[](#foggle)

A feature flagging package for Laravel, built with DX in mind.

Note

Some features are not yet implemented:

- Feature resolutions purge command.
- Pre-resolution hook for global flagging.

Installation
------------

[](#installation)

Install Foggle into your project using composer:

```
composer require youcanshop/foggle
```

You should then publish the configuration files using the following artisan command:

```
php artisan vendor:publish --provider="YouCanShop\Foggle\FoggleServiceProvider"
```

Configuration
-------------

[](#configuration)

After publishing, the configuration file will be located at `config/foggle.php`. This is where you configure your storage providers and context resolvers. Foggle allows you to store the resolution of your feature flags in a vast array (haha) of data stores, or in an in-memory `array` driver.

Feature Definition
------------------

[](#feature-definition)

To define a feature, you can use the `define` method of the `foggle()` helper. You will need to provide a name of the feature, as well as a closure that resolves the initial value.

Usually, a feature should be defined in a dedicated service provider. The closure will receive the `context` for the resolution as an argument, which is most commonly your application's `User` model.

```
