PHPackages                             maniaba/rule-engine - 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. maniaba/rule-engine

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

maniaba/rule-engine
===================

A flexible and extensible framework for defining and evaluating rules and conditions, and executing corresponding actions based on specified conditions

19.5k—7.1%[3 PRs](https://github.com/maniaba/rule-engine/pulls)PHPCI passing

Since Jul 21Pushed 5mo agoCompare

[ Source](https://github.com/maniaba/rule-engine)[ Packagist](https://packagist.org/packages/maniaba/rule-engine)[ RSS](/packages/maniaba-rule-engine/feed)WikiDiscussions develop Synced 1mo ago

READMEChangelogDependenciesVersions (4)Used By (0)

Rule Engine
===========

[](#rule-engine)

[![PHPUnit](https://github.com/maniaba/rule-engine/actions/workflows/phpunit.yml/badge.svg)](https://github.com/maniaba/rule-engine/actions/workflows/phpunit.yml)[![PHPStan](https://github.com/maniaba/rule-engine/actions/workflows/phpstan.yml/badge.svg)](https://github.com/maniaba/rule-engine/actions/workflows/phpstan.yml)[![Psalm](https://github.com/maniaba/rule-engine/actions/workflows/psalm.yml/badge.svg)](https://github.com/maniaba/rule-engine/actions/workflows/psalm.yml)[![Coverage Status](https://camo.githubusercontent.com/ba9b7db28b131cf428d64261ccbe6094b107c0dc78bab37d4a2ff8389c2a3fc3/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f6d616e696162612f72756c652d656e67696e652f62616467652e7376673f6272616e63683d646576656c6f70)](https://coveralls.io/github/maniaba/rule-engine?branch=develop)[![Docs](https://github.com/maniaba/rule-engine/actions/workflows/docs.yml/badge.svg)](https://github.com/maniaba/rule-engine/actions/workflows/docs.yml)

[![PHP](https://camo.githubusercontent.com/d6aac44f81cb2e6f4e71f098a1cb4a71992f24f7bfb424f6670db8313c9a855c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d253545382e312d626c7565)](https://camo.githubusercontent.com/d6aac44f81cb2e6f4e71f098a1cb4a71992f24f7bfb424f6670db8313c9a855c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d253545382e312d626c7565)[![License](https://camo.githubusercontent.com/d6bc2b26794002c24d023acaab01b6dbb953c57ab9cb80ba5b8aa2f2bd5de99a/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d626c7565)](https://camo.githubusercontent.com/d6bc2b26794002c24d023acaab01b6dbb953c57ab9cb80ba5b8aa2f2bd5de99a/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d626c7565)

The Rule Engine is a flexible and extensible framework for defining and evaluating rules and conditions, and executing corresponding actions based on specified conditions.

Requirements
------------

[](#requirements)

- PHP 8.1 or higher
- Composer

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

[](#installation)

Install the package via Composer:

```
composer require maniaba/rule-engine
```

For detailed installation instructions and verification, see the [Installation Documentation](https://maniaba.github.io/rule-engine/installation/).

Key Features
------------

[](#key-features)

- Define rules using a structured array configuration
- Combine multiple conditions with logical operators (AND, OR)
- Execute actions based on condition results
- Extend with custom conditions and actions
- Validate rule configurations

Quick Example
-------------

[](#quick-example)

```
