PHPackages                             jlis/judge - 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. jlis/judge

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

jlis/judge
==========

Judge handles feature and value toggles/flaggings for Laravel.

v1.0.4(9y ago)21.0k[4 issues](https://github.com/jlis/judge/issues)MITPHPPHP &gt;=5.6.0

Since May 8Pushed 8y ago2 watchersCompare

[ Source](https://github.com/jlis/judge)[ Packagist](https://packagist.org/packages/jlis/judge)[ Docs](http://github.com/jlis/judge)[ RSS](/packages/jlis-judge/feed)WikiDiscussions master Synced 1mo ago

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

Judge - Judge handles feature and value toggles/flaggings for Laravel.
======================================================================

[](#judge---judge-handles-feature-and-value-togglesflaggings-for-laravel)

The easy way to toggle/decide features and values.

[![Build Status](https://camo.githubusercontent.com/99ae4c132021608eebace6beb2fb7c4057076d297895c0905300896a8281b672/68747470733a2f2f7472617669732d63692e6f72672f6a6c69732f6a756467652e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/jlis/judge)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/8e593c08b33dab912161152ed6e4687170ce2a99729b01b3a2e6d38b498795d0/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6a6c69732f6a756467652f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/jlis/judge/?branch=master)[![Code Coverage](https://camo.githubusercontent.com/5ece200a04133ccea1320caf9d71703767a83707cf8c1f582427743f1c608e75/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6a6c69732f6a756467652f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/jlis/judge/?branch=master)[![StyleCI](https://camo.githubusercontent.com/13e97d6f38410ec4e8fbd3320da1c6c814fcff000d746f2a248139d6315404ed/68747470733a2f2f7374796c6563692e696f2f7265706f732f33333931383430392f736869656c64)](https://styleci.io/repos/33918409)[![SensioLabsInsight](https://camo.githubusercontent.com/0d851bb4ce82b14a6e68302a1c8ccfaf2a8c3ec65e08f30150e32c806b75566b/68747470733a2f2f696e73696768742e73656e73696f6c6162732e636f6d2f70726f6a656374732f64623932366538612d646136322d343165662d623638392d3737653966343863663736352f6d696e692e706e67)](https://insight.sensiolabs.com/projects/db926e8a-da62-41ef-b689-77e9f48cf765)[![Total Downloads](https://camo.githubusercontent.com/bd63c9da2e746a8941830254529c2351d59139ca3187931b621816fc4100e8b1/68747470733a2f2f706f7365722e707567782e6f72672f6a6c69732f6a756467652f646f776e6c6f616473)](https://packagist.org/packages/jlis/judge)

- [Installation](#installation).
- [Feature configuration](#features).
- [Feature configuration examples](#featuresExamples).
- [Value configuration](#values).
- [Value configuration examples](#valuesExamples).
- [Voters](#voters).
- [Adapters](#adapters).
- [Usage](#usage).
- [TBD](#tbd).

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

[](#installation)

First, pull in the package through Composer.

```
composer require jlis/judge

```

And then include the service provider within `app/config/app.php`.

```
'providers' => [
    Jlis\Judge\JudgeServiceProvider::class,
];
```

And, for convenience, add a facade alias to this same file at the bottom:

```
'aliases' => [
    'Feature' => Jlis\Judge\Feature::class,
    'Value'   => Jlis\Judge\Value::class,
];
```

Copy the package configs to your local config with the publish command:

```
php artisan vendor:publish

```

Feature configuration
---------------------

[](#feature-configuration)

The feature configuration is stored in:

```
app/config/features.php

```

A **feature** is defined as something which is either on or off and should be only used for that kind of toggles. Lets see:

```
'show_memory_usage' => [
    [
        'value'   => true,
        'filters' => ['debug:true'],
    ],
],
```

The name of the feature is `show_memory_usage` and it should return true if the "debug" Voter returns true (it checks whether the debug mode is enabled or not, see *DebugVoter.php*)

Note that the default value of a **feature**, if not defined otherwise, is always **false**.

Feature configuration examples
------------------------------

[](#feature-configuration-examples)

A simple feature without any filters ( *note that the value can also be a string like "true", "on" or "1", it will be converted into a boolean* ):

```
'enable_captcha' => [
    [
        'value'   => true,
    ],
],
```

A feature with multiple filters chained in an **AND** condition:

```
'enable_captcha' => [
    [
        'value'   => true,
        'filters' => ['env:production', 'expression_language:user==null'],
    ],
],
```

A feature with multiple filters chained in an **OR** condition:

```
'enable_captcha' => [
    [
        'value'   => true,
        'filters' => ['expression_language:user==null'],
    ],
    [
        'value'   => true,
        'filters' => ['env:production'],
    ],
],
```

A feature with a **negated** filter:

```
'enable_debug_output' => [
    [
        'value'   => true,
        'filters' => ['!env:production'],
    ],
],
```

Value configuration
-------------------

[](#value-configuration)

The value configuration is stored in:

```
app/config/values.php

```

The **value** however is something which always returns a value (whoa) like a string or number for example:

```
'greeting' => [
    [
        'value'   => 'Hello my lady!',
        'filters' => ['expression_language:user.getGender()=="female"'],
    ],
    [
        'value' => 'Hello sir.',
    ],
]
```

This name of the value is `greeting`. It should return "Hello my lady!" if the expression voter return true (assuming the given user is not NULL and it's gender is female). Otherwise it should return "Hello sir.". (Sorry for the gender guessing)

(*ExpressionVoter.php* uses the Symfony Expression Language to check if the given expression is true)

Value configuration examples
----------------------------

[](#value-configuration-examples)

A simple value without any filters :

```
'package_price' => [
    [
        'value'   => 10.00,
    ],
],
```

A value with one filter and a default value:

```
'package_price' => [
    [
        'value'   => 00.00,
        'filters' => ['expression_language:user.hasPlan("premium")'],
    ],
    [
        'value'   => 10.00,
    ],
],
```

A value with multiple filters chained in an **AND** condition and a default value:

```
'package_price' => [
    [
        'value'   => 5.00,
        'filters' => ['expression_language:user.getRegisterDays() >= 365', 'made_at_least_one_purchase'],
    ],
    [
        'value'   => 10.00,
    ],
],
```

Voters
------

[](#voters)

The actual voters can be registered here:

```
app/config/judge.php

```

The voters contain the logic to decide whether the given filter should return true or false. This decides if either a feature is *on* or *off* or what a value should return regarding to it's config.

Adapters
--------

[](#adapters)

By default, Judge uses the Laravel config to read the features/values. You can choose between the **config**, **redis** and **cache** adapter.

```
app/config/judge.php

```

If you want to add you own adapter, go for it. Just implement the **AdapterInterface**.

Usage
-----

[](#usage)

Within your controllers, you can use this for example...

```
$greeting = Value::decide('greeting', $this->getUser());
echo $greeting;
```

Or this:

```
if (Feature::decide('show_memory_usage', Auth::user())) {
    echo 'Memory usage: ' . memory_get_usage();
}
```

tbd
---

[](#tbd)

- Breakers

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance0

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 89.5% 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 ~0 days

Total

5

Last Release

3297d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/25b826c5ac145a7fb5a19710a1b04b940ca8cc801f3503d35af4afbaf6fe3283?d=identicon)[jlis](/maintainers/jlis)

---

Top Contributors

[![jlis](https://avatars.githubusercontent.com/u/1401164?v=4)](https://github.com/jlis "jlis (17 commits)")[![scrutinizer-auto-fixer](https://avatars.githubusercontent.com/u/6253494?v=4)](https://github.com/scrutinizer-auto-fixer "scrutinizer-auto-fixer (2 commits)")

---

Tags

laravelfeaturetoggledecidervaluedecisionfeatureflagjudgefeaturetoggle

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/jlis-judge/health.svg)

```
[![Health](https://phpackages.com/badges/jlis-judge/health.svg)](https://phpackages.com/packages/jlis-judge)
```

###  Alternatives

[francescomalatesta/laravel-feature

A simple package to manage feature flagging in a Laravel project.

211206.4k](/packages/francescomalatesta-laravel-feature)[interaction-design-foundation/laravel-geoip

Support for multiple Geographical Location services.

17221.0k3](/packages/interaction-design-foundation-laravel-geoip)[jaybizzle/hasmeta

Access model meta data as if it was a property on your model

291.9k](/packages/jaybizzle-hasmeta)

PHPackages © 2026

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