hipster/user-discounts

A simple Laravel package to manage user-level discounts

Maintainers

Package info

github.com/sganesh088/user-discounts

pkg:composer/hipster/user-discounts

Statistics

Installs: 4

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

v1.0.0 2025-09-27 13:25 UTC

This package is not auto-updated.

Last update: 2026-03-01 07:47:42 UTC


README

The hipster/user-discounts package is a clean, testable, and extensible Laravel package for managing user discounts. It supports assigning, applying, revoking, and auditing discounts with support for idempotency, discount capping, and modular services.

Installation

Install via Composer:

composer require hipster/user-discounts

## After Requiring the Package
composer dump-autoload

php artisan vendor:publish --provider="Hipster\UserDiscounts\Providers\DiscountServiceProvider"

###Run Package Migrations via --path
php artisan migrate --path=vendor/hipster/user-discounts/database/migrations

Automated Tests

Run Full Test Suite

git clone git@github.com:sganesh088/user-discounts.git
cd user-discounts
composer install
vendor/bin/phpunit

Run Specific Test Files

# Run all unit tests
vendor/bin/phpunit tests/Unit/DiscountServiceCappingTest.php
vendor/bin/phpunit --filter DiscountServiceCappingTest

Run a Single Test Method

### idempotency_key
vendor/bin/phpunit --filter test_applies_discount_with_same_idempotency_key
vendor/bin/phpunit --filter test_applies_discount_usage_cap