PHPackages                             aiarmada/promotions - 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. aiarmada/promotions

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

aiarmada/promotions
===================

Automatic promotions and discount campaigns for commerce

v1.0.0(3mo ago)017MITPHPPHP ^8.4

Since Mar 20Pushed 1mo agoCompare

[ Source](https://github.com/AIArmada/promotions)[ Packagist](https://packagist.org/packages/aiarmada/promotions)[ RSS](/packages/aiarmada-promotions/feed)WikiDiscussions main Synced 3w ago

READMEChangelogDependencies (5)Versions (35)Used By (0)

Promotions
==========

[](#promotions)

Automatic promotional discounts and campaigns for commerce applications.

Features
--------

[](#features)

- **Promotion Types** — Percentage off, fixed amount, and Buy X Get Y discounts
- **Automatic Promotions** — Code-free promotions that apply automatically
- **Promo Codes** — Optional code-based promotions
- **Usage Limits** — Total usage and per-customer limits
- **Scheduling** — Start and end dates for time-limited campaigns
- **Stacking** — Control whether promotions can stack with others
- **Priority** — Define which promotions take precedence
- **Targeting** — Apply conditions via commerce-support targeting engine
- **Multi-tenancy** — Owner scoping for multi-tenant applications
- **Activity Logging** — Track promotion changes via Spatie ActivityLog

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

[](#requirements)

- PHP 8.4+
- Laravel 12+
- commerce-support package

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

[](#installation)

```
composer require aiarmada/promotions
```

Publish and run migrations:

```
php artisan vendor:publish --tag=promotions-migrations
php artisan migrate
```

Optionally publish the config:

```
php artisan vendor:publish --tag=promotions-config
```

Quick Start
-----------

[](#quick-start)

```
use AIArmada\Promotions\Models\Promotion;
use AIArmada\Promotions\Enums\PromotionType;

// Create a 20% off promotion
$promotion = Promotion::create([
    'name' => 'Summer Sale',
    'type' => PromotionType::Percentage,
    'discount_value' => 20, // 20%
    'is_active' => true,
    'starts_at' => now(),
    'ends_at' => now()->addMonth(),
]);

// Create a promo code
$codePromo = Promotion::create([
    'name' => 'Welcome Discount',
    'code' => 'WELCOME10',
    'type' => PromotionType::Fixed,
    'discount_value' => 1000, // $10.00 in cents
    'usage_limit' => 100,
    'is_active' => true,
]);

// Calculate discount
$discount = $promotion->calculateDiscount(5000); // 1000 cents ($10)
```

Configuration
-------------

[](#configuration)

```
// config/promotions.php
return [
    'database' => [
        'tables' => [
            'promotions' => 'promotions',
            'promotionables' => 'promotionables',
        ],
        'json_column_type' => 'json',
    ],

    'features' => [
        'owner' => [
            'enabled' => true,
            'include_global' => false,
            'auto_assign_on_create' => true,
        ],
    ],
];
```

Promotion Types
---------------

[](#promotion-types)

TypeDescription`Percentage`Percentage discount (e.g., 20% off)`Fixed`Fixed amount in cents (e.g., $10 off)`BuyXGetY`Buy X items, get Y freeLicense
-------

[](#license)

MIT License. See [LICENSE](LICENSE) for details.

###  Health Score

44

—

FairBetter than 91% of packages

Maintenance88

Actively maintained with recent releases

Popularity8

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity63

Established project with proven stability

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 ~2 days

Total

34

Last Release

25d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1634949?v=4)[Saiffil Fariz](/maintainers/sairiz)[@sairiz](https://github.com/sairiz)

### Embed Badge

![Health badge](/badges/aiarmada-promotions/health.svg)

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

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3345.1M337](/packages/psalm-plugin-laravel)[fleetbase/core-api

Core Framework and Resources for Fleetbase API

1232.2k16](/packages/fleetbase-core-api)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

245.2k](/packages/aedart-athenaeum)

PHPackages © 2026

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