PHPackages                             addgod/evaluator - 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. addgod/evaluator

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

addgod/evaluator
================

Laravel package for symfony expression language component

v1.2.2(6y ago)09MITPHPPHP &gt;=7.0

Since Feb 24Pushed 6y ago1 watchersCompare

[ Source](https://github.com/addgod/evaluator)[ Packagist](https://packagist.org/packages/addgod/evaluator)[ RSS](/packages/addgod-evaluator/feed)WikiDiscussions master Synced 5d ago

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

Evaluator
=========

[](#evaluator)

[![Build Status](https://camo.githubusercontent.com/309eda2ae5e0402fa7afaec3d5c12396a6b2059f57a35295e5cdc275288bbe87/68747470733a2f2f7472617669732d63692e6f72672f616464676f642f6576616c7561746f722e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/addgod/evaluator)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/03a7c592c9e384114ef81be8280e89a12d54f25e627f9e3d60c3b96818e67255/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f616464676f642f6576616c7561746f722f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/addgod/evaluator/?branch=master)[![Coverage Status](https://camo.githubusercontent.com/11558c27146ad17e77c0015a77c141698bf362481a825539345bf2f272a7b6df/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f616464676f642f6576616c7561746f722f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/r/addgod/evaluator?branch=master)[![Latest Stable Version](https://camo.githubusercontent.com/03ab65a95125a3515b1304087cd413e10baf5c178a56799c2f0e1de0560e6d93/68747470733a2f2f706f7365722e707567782e6f72672f616464676f642f6576616c7561746f722f762f737461626c652e737667)](https://packagist.org/packages/addgod/evaluator)[![Latest Unstable Version](https://camo.githubusercontent.com/b0acdc79fe6eddf900d913161036b247bd5c3c36df6e2cfea5f7e044fa0e1b47/68747470733a2f2f706f7365722e707567782e6f72672f616464676f642f6576616c7561746f722f762f756e737461626c652e737667)](https://packagist.org/packages/addgod/evaluator)[![License](https://camo.githubusercontent.com/27ebd6508b284537ab5b13efbb146e531b2117b014d9823de553a9e94c769737/68747470733a2f2f706f7365722e707567782e6f72672f616464676f642f6576616c7561746f722f6c6963656e73652e737667)](https://packagist.org/packages/addgod/evaluator)[![SensioLabsInsight](https://camo.githubusercontent.com/e661d8fff050fa51dfa08e8016362807051f2b2598164c673f968ffe890cd395/68747470733a2f2f696e73696768742e73656e73696f6c6162732e636f6d2f70726f6a656374732f36646461326566312d623866622d343033662d613963332d6630316431363233616136632f6d696e692e706e67)](https://insight.sensiolabs.com/projects/6dda2ef1-b8fb-403f-a9c3-f01d1623aa6c)

A Laravel package and Orchestra extension for [symfony/expression-language](http://symfony.com/doc/current/components/expression_language/index.html) component.

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

[](#installation)

`composer require addgod/evaluator`

Setup
-----

[](#setup)

```
'providers' => [
	Orchestra\Memory\MemoryServiceProvider::class,
];
```

Run migration
-------------

[](#run-migration)

```
php artisan migrate
```

Adapter
-------

[](#adapter)

This package provide Orchesta Memory as the default driver.

How To Use
----------

[](#how-to-use)

### Evaluating an expression

[](#evaluating-an-expression)

```
$test = [
    'foo' => 10,
    'bar' => 5
];

echo Evaluator::evaluate('foo > bar', $test); //this will return true
```

You can also save the expression rule.

```
$test = [
    'foo' => 10,
    'bar' => 5
];

Evaluator::expression()->add('test', 'foo > bar');

echo Evaluator::evaluateRule('test', $test); //this will return true
```

For supported expressions, visit the [Symfony Expression Language Component](http://symfony.com/doc/current/components/expression_language/index.html).

### Condition

[](#condition)

Let say we want to implement 10% tax to our collection.

```
$item = [
    'price' => 100
];

$condition = [
    'target' => 'price',
    'action' => '10%',
    'rule' => 'price > 50'
];

Evaluator::expression()->add('tax', $condition);

$calculated = Evaluator::condition('tax', $item);
```

Item with multiplier.

```
$item = [
	'price' => 50,
	'quantity' => 2
];

$condition = [
    'target' => 'price',
    'action' => '10%',
    'rule' => 'price > 50',
    'multiplier' => 'quantity'
];

Evaluator::expression()->add('tax', $condition);

$calculated = Evaluator::condition('tax', $item);
```

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 95.2% 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 ~446 days

Total

5

Last Release

2315d ago

PHP version history (2 changes)v1.0.0PHP &gt;=5.4

v1.2.0PHP &gt;=7.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/2fe57cce1f6232b48c1de83fd36af399e56d83d850a4672a2087fca5e6ab3fe4?d=identicon)[Addgod](/maintainers/Addgod)

---

Top Contributors

[![ahmadshah](https://avatars.githubusercontent.com/u/4233863?v=4)](https://github.com/ahmadshah "ahmadshah (60 commits)")[![addgod](https://avatars.githubusercontent.com/u/9675235?v=4)](https://github.com/addgod "addgod (3 commits)")

---

Tags

laravelexpression-languageorchestra

### Embed Badge

![Health badge](/badges/addgod-evaluator/health.svg)

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

###  Alternatives

[grumpydictator/firefly-iii

Firefly III: a personal finances manager.

22.8k69.3k](/packages/grumpydictator-firefly-iii)[stephenjude/filament-blog

Filament Blog Builder

20317.8k](/packages/stephenjude-filament-blog)

PHPackages © 2026

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