Download the PHP package frittenkeez/laravel-vouchers without Composer

On this page you can find all versions of the php package frittenkeez/laravel-vouchers. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-vouchers

Laravel Vouchers

Packagist Downloads GitHub Workflow Status

Table of Contents

Installation

Install this package via Composer:

Upgrading

Please read the upgrade guide.

Changelog

Please read the release notes.

Configuration

Publish config using Artisan command:

Publish migrations using Artisan command:

Don't forget to run migrations:

Change basic configuration through config/vouchers.php - it should be well documented, so no need to describe all options here.

Usage

This package comes with an ease-of-use facade Vouchers with FQN FrittenKeeZ\Vouchers\Facades\Vouchers.

Generate Codes

Generating codes without checking if they exist; defaults from config will be used if not specified.

Batch generation of codes is also possible; these will be checked against existing codes.

Create Vouchers

Generating one or more vouchers is just as simple.

Redeem Vouchers

Redeeming vouchers requires that one provides a redeemer entity.
Additional metadata for the redeemer can be provided.

Options

Besides defaults specified in config/vouchers.php, one can override options when generating codes or creating vouchers.
Following methods apply to Vouchers::generate(), Vouchers::batch() and Vouchers::create() calls.

Following methods only apply to Vouchers::create() call.

All calls are chainable and dynamic options will be reset when calling Vouchers::create() or Vouchers::reset().

Events

During events Voucher::$redeemer will be set to the active redeemer (FrittenKeeZ\Vouchers\Models\Redeemer).

By default vouchers will be marked as redeemed after one use, which is not always the desired outcome.
To allow a voucher to be redeemed multiple times, subscribe to the FrittenKeeZ\Vouchers\Models\Voucher::shouldMarkRedeemed() event.

To prevent a voucher from being redeemed altogether, subscribe to the FrittenKeeZ\Vouchers\Models\Voucher::redeeming() event.

To prevent a voucher from being redeemed by anyone but the related user.

To perform additional actions after a vouchers has been redeemed, subscribe to the FrittenKeeZ\Vouchers\Models\Voucher::redeemed() event.

Traits

For convenience we provide some traits for fetching vouchers and redeemers for related entities, fx. users.
FrittenKeeZ\Vouchers\Concerns\HasRedeemers

FrittenKeeZ\Vouchers\Concerns\HasVouchers

You can also create vouchers owned by an entity using these convenience methods.

Helpers

Check whether a voucher code is redeemable without throwing any errors.

Check whether a voucher code exists, optionally also checking a provided list.

Additional helpers methods on Voucher model.

Scopes

For convenience we also provide Voucher scopes matching the helper methods.

Testing

Running tests can be done either through composer, or directly calling the PHPUnit binary.

License

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


All versions of laravel-vouchers with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
illuminate/config Version ^9.0|^10.0|^11.0
illuminate/console Version ^9.0|^10.0|^11.0
illuminate/database Version ^9.0|^10.0|^11.0
illuminate/support Version ^9.0|^10.0|^11.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package frittenkeez/laravel-vouchers contains the following files

Loading the files please wait ....