clearlyip/laravel-flipt

A Flipt client for Laravel

Installs: 21

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 0

Forks: 0

Open Issues: 1

pkg:composer/clearlyip/laravel-flipt

1.0.0 2025-10-09 05:54 UTC

This package is auto-updated.

Last update: 2025-10-09 06:00:04 UTC


README

Laravel-flipt was created by, and is maintained by Andrew Nagy, the package is designed to allow Laravel to work with Flipt

Total Downloads Latest Stable Version License

Features

  • Registers as a driver for Laravel Pennant
  • Registers a Flipt client class to access the API directly
  • Utilizes Laravel's cache system to store flags in cache for quick access with configurable TTL

Installation & Usage

Requires PHP 8.4+

Require Laravel-flipt using Composer:

composer require clearlyip/laravel-flipt

Laravel Version Compatibility

Laravel Laravel Flipt
12.x 1.x

Usage

Configuration Files

  • Publish the Laravel Flipt configuration file using the vendor:publish Artisan command. The flipt configuration file will be placed in your config directory (Use --force to overwrite your existing clearly config file):
    • php artisan vendor:publish --tag="flipt" [--force]

All options are fully documented in the configuration file

Pennant

Register the driver for Laravel Pennant in the pennant.php configuration file

'default' => env('PENNANT_STORE', 'flipt'),
'stores' => [
    'array' => [
        'driver' => 'array',
    ],

    'flipt' => [
        'driver' => 'flipt',
    ],
],

User

Use the hasFeatures trait on your User model

Configure what parameters to use for entityId and context in the flipt configuration file

'identity' => [
    'identifier' => 'id',
    'context' => [
        'email' => 'email',
        'my-value' => 'dot.notation.is.supported',
    ],
],

Accessing

The Flipt Class can be accessed through Laravel's Container. The returned class is https://github.com/clearlyip/laravel-flipt

$flipt = App::make(Flipt::class);