Laravel-promocodes is an awesome coupon and promotional code generator for Laravel. The current release is for Laravel 9.x and PHP 8.1. It's completely rewritten, if you use the previous version, you should change your code accordingly. The code is simplified now and it should take you several minutes to completely rewrite usage.

use Zorb\Promocodes\Facades\Promocodes; Promocodes::mask('AA-***-BB') // default: config('promocodes.code_mask') ->characters('ABCDE12345') // default: config('promocodes.allowed_symbols') ->multiUse() // default: false ->unlimited() // default: false ->boundToUser() // default: false ->user(User::find(1)) // default: null ->count(5) // default: 1 ->usages(5) // default: 1 ->expiration(now()->addYear()) // default: null ->details([ 'discount' => 50 ]) // default: [] ->create(); Using helper
Newsletter

Get the latest Laravel/PHP jobs, events and curated articles straight to your inbox, once a week

Glimpse streamlines Laravel development by seamlessly deploying GitHub pull requests to preview environments with the help of Laravel Forge. Glimpse streamlines Laravel development by seamlessly deploying GitHub pull requests to preview environments with the help of Laravel Forge.
Fathom Analytics | Fast, simple and privacy-focused website analytics. Fathom Analytics | Fast, simple and privacy-focused website analytics.
Shirts painstakingly handcrafted by under-caffeinated developers. Shirts painstakingly handcrafted by under-caffeinated developers.
Community Partners