PHPackages                             msaid/laravel-coupons - 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. msaid/laravel-coupons

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

msaid/laravel-coupons
=====================

Coupon generator for Laravel

v1.0.0(2y ago)143MITPHPPHP ^8.0

Since Jan 27Pushed 2y agoCompare

[ Source](https://github.com/EG-Mohamed/laravel-coupons)[ Packagist](https://packagist.org/packages/msaid/laravel-coupons)[ Docs](https://github.com/aberkanimed/laravel-coupons)[ RSS](/packages/msaid-laravel-coupons/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (3)Versions (2)Used By (0)

Laravel Coupons
===============

[](#laravel-coupons)

[![Latest Stable Version](https://camo.githubusercontent.com/cab0b6584831504abdbd85a51e98db4e1df1ac57bac922d4245b58a15929f5c2/68747470733a2f2f706f7365722e707567782e6f72672f616265726b616e696465762f6c61726176656c2d636f75706f6e732f76)](//packagist.org/packages/aberkanidev/laravel-coupons) [![Total Downloads](https://camo.githubusercontent.com/993ac42b5bf0cb5d0b5623bf4383c289a1d017721b34d698a40e12c12f7095e7/68747470733a2f2f706f7365722e707567782e6f72672f616265726b616e696465762f6c61726176656c2d636f75706f6e732f646f776e6c6f616473)](//packagist.org/packages/aberkanidev/laravel-coupons) [![License](https://camo.githubusercontent.com/466b4850868e96e3f44cbdfca25313cd0f1549de8b2b6238624463ed07caf802/68747470733a2f2f706f7365722e707567782e6f72672f616265726b616e696465762f6c61726176656c2d636f75706f6e732f6c6963656e7365)](//packagist.org/packages/aberkanidev/laravel-coupons)

Laravel coupons is a package that allows you to add coupons system to your laravel app. The coupons can be associated with Eloquent models, and they can be redeemed by any Eloquent model you choose, not only User model.

Here is an example:

```
$item = Item::find(1);
$customer = Customer::find(1);

$coupon = $Item->createDisposableCoupon();

$customer->redeemCoupon($coupon);
```

Table of content
----------------

[](#table-of-content)

- Installation
- Usage
- License

Installation
------------

[](#installation)

Install the package via composer

```
composer require aberkanidev/laravel-coupons
```

To publish the migration run:

```
php artisan vendor:publish --provider="aberkanidev\Coupons\CouponsServiceProvider" --tag="migrations"
```

To publish config file run:

```
php artisan vendor:publish --provider="aberkanidev\Coupons\CouponsServiceProvider" --tag="config"
```

Config file example:

```
