PHPackages                             code4mk/lara-coupon - 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. code4mk/lara-coupon

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

code4mk/lara-coupon
===================

Easily create coupons with lara-coupon

417PHP

Since May 5Pushed 7y ago1 watchersCompare

[ Source](https://github.com/code4mk/lara-coupon)[ Packagist](https://packagist.org/packages/code4mk/lara-coupon)[ RSS](/packages/code4mk-lara-coupon/feed)WikiDiscussions master Synced 4d ago

READMEChangelogDependenciesVersions (1)Used By (0)

[![](https://user-images.githubusercontent.com/17185462/57058050-40a38880-6ccf-11e9-974f-8324b01f8a72.png)](https://user-images.githubusercontent.com/17185462/57058050-40a38880-6ccf-11e9-974f-8324b01f8a72.png)

lara-coupon
===========

[](#lara-coupon)

easily create laravel coupon code with with lara-coupon

installation
============

[](#installation)

```
composer require code4mk/lara-coupon
```

setup
=====

[](#setup)

1) vendor publish
-----------------

[](#1-vendor-publish)

```
php artisan vendor:publish --provider="Code4mk\LaraCoupon\LaraCouponServiceProvider" --tag=config
php artisan vendor:publish --provider="Code4mk\LaraCoupon\LaraCouponServiceProvider" --tag=migrations
```

2) config
---------

[](#2-config)

- `config/laraCoupon.php`
- setup `expired time`,`prefix`,`code length`
- `expire time ` must be follow [P7Y5M4DT4H3M2S](https://www.php.net/manual/en/datetime.add.php)

```
"expired" => "PT12M",
"isCodePrefix" => true,
"codePrefix" => "PMM-",
"codeLenght" => 10
```

- `php artisan config:clear`

method
======

[](#method)

`create()`
----------

[](#create)

```
use KCoupon;
KCoupon::create($authUser)
```

- create method has more request data
- `code,quantity,type,amount,product_id,user_id,rsingle,description`
- if you want auto code that time don't use `code` in request query
- if coupon code will need quantity that time use request query `quantity=integer` as `?quantity=20`
- type is fix or per (percent) `?type=fix` , `?type=per`
- amount `?amount=120`, `?amount=10`
- specific product's coupon `?product_id=12`
- specific user's coupon `?user_id=2`
- redeem one user only one time `?rsingle=true`
- all products coupon for all user

    - without query `product_id,user_id`

`singleRedeem()`
----------------

[](#singleredeem)

```
use KCoupon;
KCoupon::singleRedeem($code, $authUser)
```

`singleUnredeem()`
------------------

[](#singleunredeem)

```
use KCoupon;
KCoupon::singleUnredeem($code, $authUser)
```

`redeem()`
----------

[](#redeem)

```
use KCoupon;
KCoupon::redeem($code)
```

`unredeam()`
------------

[](#unredeam)

```
use KCoupon;
KCoupon::unredeam($code)
```

lists
-----

[](#lists)

```
use KCoupon;
KCoupon::lists();
```

activeLists
-----------

[](#activelists)

```
use KCoupon;
KCoupon::activeLists();
```

deactiveLists
-------------

[](#deactivelists)

```
use KCoupon;
KCoupon::deactiveLists();
```

general
-------

[](#general)

```
use KCoupon;
KCoupon::general();
```

`delete`
--------

[](#delete)

```
use KCoupon;
KCoupon::delete($code);
```

`check`
-------

[](#check)

```
use KCoupon;
KCoupon::check($code,$authUser);
```

- check return

```
"status" => ,
"type" => ,
"is_product" => ,
"is_user" => ,
"is_quantity" => ,
"is_rsingle" => ,
"amount" =>
```

[](https://twitter.com/0devco)

[![](https://raw.githubusercontent.com/0devco/docs/master/.devco-images/logo-transparent.png)](https://raw.githubusercontent.com/0devco/docs/master/.devco-images/logo-transparent.png)

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity37

Early-stage or recently created project

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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/5e3bffe09346f036f5a42f64d3b771b9bf41a44ffd712caecac932f69f990ed7?d=identicon)[code4mk](/maintainers/code4mk)

---

Tags

code4mkcouponlaravellaravel-couponlaravel-promolaravel-voucharpromo-codevouchar

### Embed Badge

![Health badge](/badges/code4mk-lara-coupon/health.svg)

```
[![Health](https://phpackages.com/badges/code4mk-lara-coupon/health.svg)](https://phpackages.com/packages/code4mk-lara-coupon)
```

###  Alternatives

[spatie/laravel-cookie-consent

Make your Laravel app comply with the crazy EU cookie law

1.5k4.7M20](/packages/spatie-laravel-cookie-consent)[czproject/git-php

Library for work with Git repository in PHP.

5544.9M81](/packages/czproject-git-php)[async-aws/async-aws-bundle

Configure all your AsyncAws services and enjoy the autowire greatness.

243.6M2](/packages/async-aws-async-aws-bundle)[sheadawson/silverstripe-rateable

An extension that adds a star rating system + UI to any DataObject type.

204.6k1](/packages/sheadawson-silverstripe-rateable)

PHPackages © 2026

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