Coupons and promotional codes generator for Laravel Nova. This package is created for zgabievi/laravel-promocodes.
You can install the package via composer:
composer require zgabievi/nova-promocodes
php artisan vendor:publish --provider="Zorb\NovaPromocodes\ToolServiceProvider"
Now you can change configurations as you need:
return [
'models' => [
'promocodes' => [
'resource' => \Zorb\NovaPromocodes\Resources\Promocode::class,
],
'users' => [
'resource' => \App\Nova\User::class,
],
],
];
After you configure this file, run migrations:
php artisan migrate
It's very easy to use. Methods are combined, so that you can configure promocodes easily.
Name | Explanation |
---|---|
Mask | Astrisks will be replaced with random symbol |
Characters | Allowed symbols to use in mask replacement |
Multi use | Define if single code can be used multiple times, by the same user |
Unlimited | Generated code will have unlimited usages |
Bound to user | Define if promocode can be used only one user, if user is not assigned initially, first user will be bound to promocode |
User | Define user who will be initially bound to promocode |
Count | Amount of unique promocodes should be generated |
Usages | Define how many times can promocode be used |
Expiration | DateTime when promocode should be expired. Null means that promocode will never expire |
Details | Array of details which will be retrieved upon apply |
Include promocodes tool inside nova service provider.
use Zorb\NovaPromocodes\PromocodesTool;
class NovaServiceProvider extends NovaApplicationServiceProvider
{
// ...
/**
* Get the tools that should be listed in the Nova sidebar.
*
* @return array
*/
public function tools()
{
return [
PromocodesTool::make(),
];
}
}
For more information about parent package, visit zgabievi/laravel-promocodes.
Please see CONTRIBUTING for details.
The MIT License (MIT). Please see License File for more information.