Eligify is a flexible rule and criteria engine that determines whether an entity — such as a person, application, or transaction — meets the defined acceptance conditions. It powers decision-making systems by making eligibility data-driven, traceable, and automatable.
- 🧱 Criteria Builder - Define eligibility requirements with weighted rules
- ⚖️ Rule Engine - 16+ operators for comprehensive validation
- 🎯 Evaluator - Real-time eligibility checks with detailed scoring
- 🔄 Workflow Manager - Trigger actions on pass/fail/excellent scores
- 🧾 Audit Log - Complete traceability of all decisions
- 🎨 Web Dashboard - Optional Telescope-style UI for management (disabled by default)
- 🧩 Model Integration - Seamless Laravel Eloquent integration
- 📊 Flexible Scoring - Weighted, pass/fail, percentage, and custom methods
- ⚡ Smart Caching - Built-in evaluation and rule compilation caching for optimal performance (experimental)
You can install the package via composer:
composer require cleaniquecoders/eligifyYou can publish and run the migrations with:
php artisan vendor:publish --tag="eligify-migrations"
php artisan migrateYou can publish the config file with:
php artisan vendor:publish --tag="eligify-config"use CleaniqueCoders\Eligify\Facades\Eligify;
// Define criteria
$criteria = Eligify::criteria('Loan Approval')
->addRule('credit_score', '>=', 650, 30)
->addRule('annual_income', '>=', 30000, 25)
->addRule('debt_ratio',
'<=', 43, 20)
->passThreshold(70)
->save();
// Evaluate
$result = $criteria->evaluateWithCallbacks($data);Eligify includes built-in security features:
- Input Validation: All evaluation data is validated for length and suspicious content
- Rate Limiting: Configurable rate limits to prevent abuse
- Authorization: Dashboard access controlled via Gates/closures (similar to Telescope)
- Audit Logging: Complete audit trail of all evaluations and decisions
- Safe Operators: Dangerous operators like regex can be disabled in production
// config/eligify.php
'security' => [
'validate_input' => true,
'max_field_length' => 255,
'max_value_length' => 1000,
'log_violations' => true,
],
'rate_limiting' => [
'enabled' => true,
'max_attempts' => 100,
'decay_minutes' => 1,
],// In AppServiceProvider
Gate::define('viewEligify', function ($user) {
return $user->hasRole('admin');
});Eligify is optimized for high-performance scenarios:
- Smart Caching: Evaluation results and rule compilation caching
- Eager Loading: Optimized database queries to prevent N+1 problems
- Batch Processing: Efficient batch evaluation with memory management
- Query Optimization: Rules are loaded with criteria to minimize database hits
// config/eligify.php
'performance' => [
'compile_rules' => true,
'batch_size' => 100,
],
'evaluation' => [
'cache_enabled' => true,
'cache_ttl' => 60, // minutes
],Eligify includes built-in security features:
- Input Validation: All evaluation data is validated for length and suspicious content
- Rate Limiting: Configurable rate limits to prevent abuse
- Authorization: Dashboard access controlled via Gates/closures (similar to Telescope)
- Audit Logging: Complete audit trail of all evaluations and decisions
- Safe Operators: Dangerous operators like regex can be disabled in production
// config/eligify.php
'security' => [
'validate_input' => true,
'max_field_length' => 255,
'max_value_length' => 1000,
'log_violations' => true,
],
'rate_limiting' => [
'enabled' => true,
'max_attempts' => 100,
'decay_minutes' => 1,
],// In AppServiceProvider
Gate::define('viewEligify', function ($user) {
return $user->hasRole('admin');
});Eligify is optimized for high-performance scenarios:
- Smart Caching: Evaluation results and rule compilation caching
- Eager Loading: Optimized database queries to prevent N+1 problems
- Batch Processing: Efficient batch evaluation with memory management
- Query Optimization: Rules are loaded with criteria to minimize database hits
// config/eligify.php
'performance' => [
'compile_rules' => true,
'batch_size' => 100,
],
'evaluation' => [
'cache_enabled' => true,
'cache_ttl' => 60, // minutes
],// Result: ['passed' => true, 'score' => 85, 'decision' => 'Approved', ...]
### Optional Web Dashboard
Enable the dashboard for visual management:
```bash
# .env
ELIGIFY_UI_ENABLED=true
Access: http://your-app.test/eligify
Authorization (Production):
// AppServiceProvider.php
Gate::define('viewEligify', function ($user) {
return $user->hasRole('admin');
});composer testPlease see CHANGELOG for more information on what has changed recently.
Please see CONTRIBUTING for details.
Please review our security policy on how to report security vulnerabilities.
The MIT License (MIT). Please see License File for more information.

