PHPackages                             mobihouse/laravel-pennant-cookie - 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. mobihouse/laravel-pennant-cookie

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

mobihouse/laravel-pennant-cookie
================================

A cookie driver for Laravel Pennant

1.0.0(1y ago)04.4k[1 PRs](https://github.com/mobihouse-io/laravel-pennant-cookie/pulls)MITPHPCI passing

Since Aug 1Pushed 1y agoCompare

[ Source](https://github.com/mobihouse-io/laravel-pennant-cookie)[ Packagist](https://packagist.org/packages/mobihouse/laravel-pennant-cookie)[ RSS](/packages/mobihouse-laravel-pennant-cookie/feed)WikiDiscussions main Synced today

READMEChangelogDependencies (4)Versions (6)Used By (0)

 [![Packagist License](https://camo.githubusercontent.com/7b8ca9661fc383016176c9d2110bbbb81b47e5373507b0e00ef8fd24663d0cf4/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6d6f6269686f7573652f6c61726176656c2d70656e6e616e742d636f6f6b6965)](https://camo.githubusercontent.com/7b8ca9661fc383016176c9d2110bbbb81b47e5373507b0e00ef8fd24663d0cf4/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6d6f6269686f7573652f6c61726176656c2d70656e6e616e742d636f6f6b6965) [![Packagist Version](https://camo.githubusercontent.com/926cad5ec11b96a9c0e2cadbc825f9023533d895d4ecd619ff2e0a2e2897c714/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6d6f6269686f7573652f6c61726176656c2d70656e6e616e742d636f6f6b6965)](https://camo.githubusercontent.com/926cad5ec11b96a9c0e2cadbc825f9023533d895d4ecd619ff2e0a2e2897c714/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6d6f6269686f7573652f6c61726176656c2d70656e6e616e742d636f6f6b6965)

Laravel Pennant - Cookie Driver
===============================

[](#laravel-pennant---cookie-driver)

This package adds the ability to remember feature flags/values from Laravel pennant in a cookie, which allows you to have persisted values for anonymous users.

Important

This driver is most suited for tracking anonymous users, if you want to track actual users it will be more beneficial to use the database driver.

Usage
-----

[](#usage)

Install the package using:

```
composer require mobihouse/laravel-pennant-cookie
```

And configure it by adding a new store to the `config/pennant.php` config file:

```
return [

    'stores' => [

        // ...
        'cookie' => [
            'driver' => 'cookie'
        ]

    ]

]
```

Now that the store is configured set your `PENNANT_STORE` environment variable to `cookie` (or set the `default` key in the pennant config to `cookie`).

### Scope

[](#scope)

Laravel Pennant will try to use the auth scope by default and thus look for a current user. Though the driver will work with this it isn't it's intended purpose, so the easiest way to use anonymised scope is setting the default scope to null:

```
