Skip to content

TIPOFF/vouchers

Repository files navigation

Laravel Package for handling Vouchers used in Ecommerce packages

Latest Version on Packagist Tests Total Downloads

Installation

You can install the package via composer:

composer require tipoff/vouchers

The migrations will run from the package. You can extend the Models from the package if you need additional classes or functions added to them.

You can publish the config file with:

php artisan vendor:publish --provider="Tipoff\Vouchers\VouchersServiceProvider" --tag="vouchers-config"

This is the contents of the published config file:

return [
    'default_redeemable_hours' => 24,
    'default_expiration_days' => 365,
];

Registering the Nova resources

If you would like to use the Nova resources included with this package, you need to register it manually in your NovaServiceProvider in the boot method.

Nova::resources([
    \Tipoff\Vouchers\Nova\Voucher::class,
    \Tipoff\Vouchers\Nova\VoucherType::class,
]);

Models

We include the following models:

List of Models

  • Voucher
  • Voucher Type

For each of these models, this package implements an authorization policy that extends the roles and permissions approach of the tipoff/authorization package. The policies for each model in this package are registered through the package and do not need to be registered manually.

The models also have Laravel Nova resources in this package and they are also registered through the package and do not need to be registered manually.

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see License File for more information.

About

Laravel Package for Vouchers & Gift Certificates

Resources

License

Security policy

Stars

Watchers

Forks

Sponsor this project

Packages

No packages published