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

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

elepunk/evaluator
=================

Laravel package for symfony expression language component

v1.0.1(11y ago)91921MITPHPPHP &gt;=5.4

Since Feb 24Pushed 11y ago1 watchersCompare

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

READMEChangelog (2)Dependencies (5)Versions (3)Used By (0)

Evaluator
=========

[](#evaluator)

[![Build Status](https://camo.githubusercontent.com/c5561dc9803af1ed60c2cfbdc5cdd260741c0fc014b8b02a74a9dbf96707cd09/68747470733a2f2f7472617669732d63692e6f72672f656c6570756e6b2f6576616c7561746f722e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/elepunk/evaluator)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/409c1f64406dad916ca4c0bd7264a511afabb7e2efa39ac950b8b129a942dd59/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f656c6570756e6b2f6576616c7561746f722f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/elepunk/evaluator/?branch=master)[![Coverage Status](https://camo.githubusercontent.com/51be4cf373b25f9ecb802cc80ad954338cdedf787899c7f0fc00678716d5bb44/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f656c6570756e6b2f6576616c7561746f722f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/r/elepunk/evaluator?branch=master)[![Latest Stable Version](https://camo.githubusercontent.com/49034eade74971889a56ec4ec166dcc0726185174bc3975639f3be7be8aa8b54/68747470733a2f2f706f7365722e707567782e6f72672f656c6570756e6b2f6576616c7561746f722f762f737461626c652e737667)](https://packagist.org/packages/elepunk/evaluator)[![Latest Unstable Version](https://camo.githubusercontent.com/3c709b2f8102e3ff11619f35c7096d0bd3b6629c1bc280dedfea9b8cd1ac6e9c/68747470733a2f2f706f7365722e707567782e6f72672f656c6570756e6b2f6576616c7561746f722f762f756e737461626c652e737667)](https://packagist.org/packages/elepunk/evaluator)[![License](https://camo.githubusercontent.com/65af1c477e26897b2f3e1854cda687bbee57b2b00574414248011074f609075f/68747470733a2f2f706f7365722e707567782e6f72672f656c6570756e6b2f6576616c7561746f722f6c6963656e73652e737667)](https://packagist.org/packages/elepunk/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)

Simpy update the `composer.json` file and run `composer install`.

```
"require": {
	"elepunk/evaluator": "1.0.*"
}
```

Quick Installation
------------------

[](#quick-installation)

`composer require "elepunk/evaluator=1.0.*"`

Setup
-----

[](#setup)

If you are using Orchestra Platform, you can simply enable the extension or add the service provider. This will also load the `Evaluator` alias automatically.

```
'providers' => [
	'Elepunk\Evaluator\EvaluatorServiceProvider'
];
```

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

29

—

LowBetter than 59% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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

2

Last Release

4100d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/2554da9ad5880fdb56945d1539d31e986b4bc3dba3a2791b9a8f8259408398d9?d=identicon)[shopalicious](/maintainers/shopalicious)

---

Top Contributors

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

---

Tags

laravelexpression-languageorchestra

### Embed Badge

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

```
[![Health](https://phpackages.com/badges/elepunk-evaluator/health.svg)](https://phpackages.com/packages/elepunk-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)
