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(4mo ago)04MITPHPPHP &gt;=8.1

Since Dec 14Pushed 4mo 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 2mo 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

33

—

LowBetter than 75% of packages

Maintenance74

Regular maintenance activity

Popularity3

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity43

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

148d ago

### Community

Maintainers

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

[barryvdh/laravel-ide-helper

Laravel IDE Helper, generates correct PHPDocs for all Facade classes, to improve auto-completion.

14.9k123.0M685](/packages/barryvdh-laravel-ide-helper)[orchestra/canvas

Code Generators for Laravel Applications and Packages

21017.2M158](/packages/orchestra-canvas)[illuminate/pipeline

The Illuminate Pipeline package.

9446.6M213](/packages/illuminate-pipeline)[illuminate/pagination

The Illuminate Pagination package.

10532.5M861](/packages/illuminate-pagination)[spatie/laravel-pjax

A pjax middleware for Laravel 5

513371.8k11](/packages/spatie-laravel-pjax)[spatie/laravel-mix-preload

Add preload and prefetch links based your Mix manifest

169176.0k2](/packages/spatie-laravel-mix-preload)

PHPackages © 2026

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