Download the PHP package mbsoft31/loyalty-rewards without Composer
On this page you can find all versions of the php package mbsoft31/loyalty-rewards. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download mbsoft31/loyalty-rewards
More information about mbsoft31/loyalty-rewards
Files in mbsoft31/loyalty-rewards
Package loyalty-rewards
Short Description A flexible loyalty rewards system for PHP applications
License MIT
Informations about the package loyalty-rewards
Loyalty Rewards System
A comprehensive, enterprise-grade loyalty rewards system for PHP applications. Built with Domain-Driven Design principles, this package provides flexible point earning/redemption, fraud detection, audit logging, and multi-tier reward programs.
Features
- Flexible Rewards Engine — Category multipliers, tier bonuses, time-based promotions
- Built-in Fraud Detection — Velocity checks, amount validation, suspicious activity alerts
- Complete Audit Trail — Full transaction logging with compliance support
- High Performance — Handles 1000+ transactions/second with optimized database queries
- Comprehensive Test Suite — Unit, feature, integration, and coverage-gated CI checks
- Framework Agnostic — Works with Laravel, Symfony, or standalone PHP applications
- Type Safe — Full PHP 8.3+ type declarations with strict type checking
Quick Start
Installation
composer require mbsoft31/loyalty-rewards
Basic Usage
Architecture Overview
Real-World Examples
E-commerce Rewards Program
Restaurant Chain Program
SaaS Referral Program
Configuration
Database Setup
Dependency Injection
Rules Configuration
Testing
The package includes comprehensive tests with a CI coverage gate:
Run all tests
Run specific test suites
Run with coverage report
Test Results
- Full suite includes unit, feature, and integration tests
- Unit tests: Value objects, domain models, rules engine
- Integration tests: Database operations, repository behavior, full service workflows
- Integration coverage includes high-volume transaction workflows
Security & Fraud Detection
Built-in fraud detection with configurable rules:
Detection Methods:
- Velocity checking (transaction frequency)
- Amount anomaly detection
- Pattern recognition
- Account behavior analysis
Performance
Benchmarked Performance:
- Single Transaction: < 100ms average
- Bulk Operations: 1000 transactions in < 10 seconds
- Memory Usage: < 50MB for 1000 transactions
- Database Queries: Optimized with proper indexing
Scalability Features:
- Connection pooling support
- Caching layer integration
- Async queue processing
- Horizontal scaling ready
Enterprise Features
Audit & Compliance
- Complete transaction audit trails
- Regulatory compliance reporting
- Data retention policies
- Encrypted sensitive data storage
Multi-Currency Support
- 7+ supported currencies (USD, EUR, GBP, NGN, etc.)
- Automatic currency conversion
- Regional formatting
- Exchange rate integration ready
Event-Driven Architecture
- Domain events for all state changes
- Easy integration with external systems
- Webhook support ready
- Real-time notifications
Documentation
- API Reference (API.md) — Complete method documentation
- Architecture Guide (ARCHITECTURE.md) — Technical design decisions
- Core Policy Engine Guide (CORE_POLICY_ENGINE.md) — Plan config, typed policy results, adapter boundaries, and release checklist
- Examples (EXAMPLES.md) — 10+ real-world implementations
- Configuration (CONFIGURATION.md) — Setup and customization options
- Laravel Adapter — Service provider, config, and migrations
Release Guide
To cut a release:
CI runs unit + integration tests on PHP 8.3, 8.4, and 8.5. Coverage gate enforces ≥80% on PHP 8.3.
Contributing
We welcome contributions! Please see CONTRIBUTING.md for guidelines.
Development Setup
License
This project is licensed under the MIT License — see the LICENSE file for details.
Links
- GitHub Repository: https://github.com/mbsoft31/loyalty-rewards
- Issues: https://github.com/mbsoft31/loyalty-rewards/issues
- Discussions: https://github.com/mbsoft31/loyalty-rewards/discussions
- Releases: https://github.com/mbsoft31/loyalty-rewards/releases
Built by mbsoft31 — Empowering businesses with flexible, scalable loyalty solutions.
All versions of loyalty-rewards with dependencies
ext-pdo Version *
psr/event-dispatcher Version ^1.0
psr/log Version ^3.0
ramsey/uuid Version ^4.7