PHPackages                             getsidekicker/flagr-feature-laravel - 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. getsidekicker/flagr-feature-laravel

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

getsidekicker/flagr-feature-laravel
===================================

Makes working with Flagr in Laravel a snap

0.1.0(3y ago)022.4k↓25%[1 PRs](https://github.com/getsidekicker/flagr-feature-laravel/pulls)MITPHPPHP ^8.0CI failing

Since Aug 6Pushed 2y ago2 watchersCompare

[ Source](https://github.com/getsidekicker/flagr-feature-laravel)[ Packagist](https://packagist.org/packages/getsidekicker/flagr-feature-laravel)[ RSS](/packages/getsidekicker-flagr-feature-laravel/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (7)Dependencies (8)Versions (10)Used By (0)

flagr-feature-laravel
=====================

[](#flagr-feature-laravel)

Prerequisites
-------------

[](#prerequisites)

To use this package, you will need to have [Flagr](https://checkr.github.io/flagr) installed and accessible

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

[](#installation)

### Publish config

[](#publish-config)

`php artisan vendor:publish --tag=flagr-feature-laravel-config`

Usage
-----

[](#usage)

### Block execution

[](#block-execution)

```
//function
feature_eval('flag',
    on: fn(object $attachment) => // do stuff when feature is on,
    otherwise: fn(object $attachment) => // do stuff when any other variant isn't matched
)

//alias
app('feature')->eval('flag',
    on: fn(object $attachment) => // do stuff when feature is on,
    otherwise: fn(object $attachment) => // do stuff when any other variant isn't matched
);
```

### Conditional

[](#conditional)

```
//function
if (feature_match('flag')) {
    // do feature when feature variant is 'on'
} else  {
    // do otherwise
}

//alias
//function
if (app('feature')->match('flag')) {
    // do feature when feature variant is 'on'
} else  {
    // do otherwise
}
```

Context
-------

[](#context)

By default, context is sent to Flagr as part of the evaluation call. This can be used to add constraints against segments.

```
{
  "env": "",
  "user": [""],
  "host": ""
}
```

Additionally, context can be set. Note that any context will be merged over the default context

```
feature_add_context([]);
app('feature')->addContext([]);
```

To ensure that consistent feature treatment is applied across requests, you can supply an optional id

```
feature_set_id('user_123');
app('feature')->setId('user_123');

// evaluation calls
```

Creating new feature flag
-------------------------

[](#creating-new-feature-flag)

Flags can be created in the format `php artisan feature:create-flag {--name} {--description} [{--tags=*}]`. This will use the simple boolean flag type within Flagr

e.g.

```
php artisan feature:create-flag --name="temp-flag" --description="Create temp flag for feature"

```

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity26

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 76.9% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~90 days

Recently: every ~134 days

Total

7

Last Release

1205d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/9bf6d3680e94dfaff53be89f68db291f0690a3dd149c3157f9c90f552c0e3270?d=identicon)[sidekicker](/maintainers/sidekicker)

---

Top Contributors

[![tristankenney](https://avatars.githubusercontent.com/u/424100?v=4)](https://github.com/tristankenney "tristankenney (30 commits)")[![nextdayflight](https://avatars.githubusercontent.com/u/295474?v=4)](https://github.com/nextdayflight "nextdayflight (9 commits)")

---

Tags

laravelfeaturefeature flagflagr

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/getsidekicker-flagr-feature-laravel/health.svg)

```
[![Health](https://phpackages.com/badges/getsidekicker-flagr-feature-laravel/health.svg)](https://phpackages.com/packages/getsidekicker-flagr-feature-laravel)
```

###  Alternatives

[worksome/exchange

Check Exchange Rates for any currency in Laravel.

123544.7k](/packages/worksome-exchange)[codinglabsau/laravel-feature-flags

Dynamic feature flags for laravel.

3861.4k](/packages/codinglabsau-laravel-feature-flags)[marcelweidum/filament-expiration-notice

Customize the livewire expiration notice

9169.0k4](/packages/marcelweidum-filament-expiration-notice)[hydrat/filament-table-layout-toggle

Filament plugin adding a toggle button to tables, allowing user to switch between Grid and Table layouts.

6292.3k1](/packages/hydrat-filament-table-layout-toggle)[ralphjsmit/laravel-helpers

A package containing handy helpers for your Laravel-application.

13704.6k2](/packages/ralphjsmit-laravel-helpers)[ziming/laravel-scrapingbee

A PHP Laravel Library for ScrapingBee

4310.6k](/packages/ziming-laravel-scrapingbee)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
