PHPackages                             mothership-ec/cog-mothership-discount-rewards - 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. mothership-ec/cog-mothership-discount-rewards

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

mothership-ec/cog-mothership-discount-rewards
=============================================

Cog module to allow discount rewards with the 'Refer a Friend' module

1.0.0(10y ago)03121GPL-3.0+PHPPHP &gt;=5.4.0

Since Mar 25Pushed 10y ago4 watchersCompare

[ Source](https://github.com/mothership-ec/cog-mothership-discount-rewards)[ Packagist](https://packagist.org/packages/mothership-ec/cog-mothership-discount-rewards)[ Docs](http://mothership.ec)[ RSS](/packages/mothership-ec-cog-mothership-discount-rewards/feed)WikiDiscussions develop Synced 1mo ago

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

Mothership Refer a Friend: Discount Rewards
===========================================

[](#mothership-refer-a-friend-discount-rewards)

The `Message\Mothership\DiscountReward` cogule is a library that plugs into the &lt;a href="[https://github.com/mothership-ec/cog-mothership-refer-a-friend""&gt;Refer](https://github.com/mothership-ec/cog-mothership-refer-a-friend%22%22%3ERefer) a Friend cogule, allowing users to receive a discount reward for referring someone to the e-commerce site.

This cogule includes:

Reward types:
-------------

[](#reward-types)

- **Discount reward** - A discount reward for the referrer.

Triggers:
---------

[](#triggers)

- **Order create** - The reward is triggered when the referred user creates an order, i.e. they buy something. The specific event that is being listened for is the `OrderEvents::CREATE_COMPLETE` event.

Constraints:
------------

[](#constraints)

- **Minimum order** - A magic constraint that will be cloned by the `MinumumOrderFactory` for each currency registered in the `currency.yml` config file. This sets how much the total gross of the order must be for the reward creation to be triggered.
- **Timeout** - A constraint that determines how long (in days) the referred user has to create an order. If the referral has timed out, it will update the status to `expired`.
    - **TODO:** Create cron task to automatically update timeouts

Reward options
--------------

[](#reward-options)

- **Discount type** - Set whether the discount is a percentage value or a specific amount.
- **Percentage value** - If the discount type is set to Percentage, this sets the value of that percentage
- **Set amount** - A magic reward type that will be cloned by the `SetAmountFactory` for each currency registered in the `currency.yml` config file. If the discount type is set to a specific amount, this determines what value the discount has, for each currency.

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

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

Total

2

Last Release

3814d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/4520924?v=4)[Thomas Marchant](/maintainers/thomasjthomasj)[@thomasjthomasj](https://github.com/thomasjthomasj)

---

Top Contributors

[![thomasjthomasj](https://avatars.githubusercontent.com/u/4520924?v=4)](https://github.com/thomasjthomasj "thomasjthomasj (28 commits)")

---

Tags

rewardscogmothershipdiscountsrefer a friend

### Embed Badge

![Health badge](/badges/mothership-ec-cog-mothership-discount-rewards/health.svg)

```
[![Health](https://phpackages.com/badges/mothership-ec-cog-mothership-discount-rewards/health.svg)](https://phpackages.com/packages/mothership-ec-cog-mothership-discount-rewards)
```

###  Alternatives

[cybercog/laravel-optimus

An Optimus bridge for Laravel. Id obfuscation based on Knuth's multiplicative hashing method.

192564.1k](/packages/cybercog-laravel-optimus)[cybercog/laravel-paket

Composer personal web interface. Manage Laravel dependencies without switching to command line!

1753.3k](/packages/cybercog-laravel-paket)

PHPackages © 2026

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