PHPackages                             teamatrk/user-discounts - 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. teamatrk/user-discounts

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

teamatrk/user-discounts
=======================

Reusable Laravel package for user-level discounts

1.0(6mo ago)04MITPHPPHP &gt;=8.1

Since Dec 14Pushed 6mo agoCompare

[ Source](https://github.com/teamatrk/user-discounts)[ Packagist](https://packagist.org/packages/teamatrk/user-discounts)[ RSS](/packages/teamatrk-user-discounts/feed)WikiDiscussions main Synced 4mo ago

READMEChangelogDependencies (3)Versions (2)Used By (0)

user-discounts
==============

[](#user-discounts)

Reusable Laravel package for user-level discounts

Install

composer require teamatrk/user-discounts

php artisan vendor:publish --provider="teamatrk\\UserDiscounts\\DiscountServiceProvider" --tag=config

php artisan vendor:publish --provider="teamatrk\\UserDiscounts\\DiscountServiceProvider" --tag=user-discounts-migrations

php artisan migrate

Usage

$discountService = app(DiscountService::class);

Create a discount limited to 3 uses per user

$discount = Discount::create(\[

```
'name'       => 'Winter Sale',
'type'       => 'percentage',
'value'      => 25,
'usage_cap'  => 3,        //  per user cap

```

\]);

$discountService-&gt;assign($user, $discount); // $user -&gt; user model

Check remaining uses

echo $discountService-&gt;remainingUses($user, $discount); // -&gt; 3

Apply multiple times

$discountService-&gt;apply($user, 100); -&gt; 75

###  Health Score

31

—

LowBetter than 66% of packages

Maintenance66

Regular maintenance activity

Popularity3

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity44

Maturing project, gaining track record

 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

Unknown

Total

1

Last Release

202d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/12029514?v=4)[teamatrk](/maintainers/teamatrk)[@teamatrk](https://github.com/teamatrk)

---

Top Contributors

[![teamatrk](https://avatars.githubusercontent.com/u/12029514?v=4)](https://github.com/teamatrk "teamatrk (2 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/teamatrk-user-discounts/health.svg)

```
[![Health](https://phpackages.com/badges/teamatrk-user-discounts/health.svg)](https://phpackages.com/packages/teamatrk-user-discounts)
```

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M346](/packages/psalm-plugin-laravel)[renatomarinho/laravel-page-speed

Laravel Page Speed

2.5k1.7M10](/packages/renatomarinho-laravel-page-speed)[illuminate/pagination

The Illuminate Pagination package.

12234.1M1.0k](/packages/illuminate-pagination)[illuminate/pipeline

The Illuminate Pipeline package.

9349.2M282](/packages/illuminate-pipeline)[illuminate/redis

The Illuminate Redis package.

8314.6M376](/packages/illuminate-redis)[illuminate/cookie

The Illuminate Cookie package.

244.6M137](/packages/illuminate-cookie)

PHPackages © 2026

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