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

ActiveLibrary

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

Automatic promotions and discount campaigns for commerce

v1.0.0(1mo ago)001MITPHPPHP ^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 1mo ago

READMEChangelogDependencies (5)Versions (2)Used By (1)

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' => [
        'table_prefix' => '',
        'tables' => [
            'promotions' => 'promotions',
            'promotionables' => 'promotionables',
        ],
        'json_column_type' => 'json',
    ],

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

    'targeting' => [
        'cache_ttl' => 3600,
    ],
];
```

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

40

—

FairBetter than 87% of packages

Maintenance96

Actively maintained with recent releases

Popularity0

Limited adoption so far

Community5

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

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

Unknown

Total

1

Last Release

50d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/726da4efcb731bc0ebcdd0b7ce64759e1f8dd63f6f771eab335458f6a2f2d3af?d=identicon)[sairiz](/maintainers/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

[fumeapp/modeltyper

Generate TypeScript interfaces from Laravel Models

196277.9k](/packages/fumeapp-modeltyper)[pressbooks/pressbooks

Pressbooks is an open source book publishing tool built on a WordPress multisite platform. Pressbooks outputs books in multiple formats, including PDF, EPUB, web, and a variety of XML flavours, using a theming/templating system, driven by CSS.

44643.1k1](/packages/pressbooks-pressbooks)[api-platform/laravel

API Platform support for Laravel

59126.4k5](/packages/api-platform-laravel)[fleetbase/core-api

Core Framework and Resources for Fleetbase API

1225.0k10](/packages/fleetbase-core-api)[aedart/athenaeum

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

255.2k](/packages/aedart-athenaeum)

PHPackages © 2026

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