Download the PHP package amestsantim/voucherator without Composer

On this page you can find all versions of the php package amestsantim/voucherator. 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 voucherator

Voucherator

Total Downloads License

The only voucher (alphanumeric code) generator you will ever need for PHP.
Voucherator has a fluent Generator class that can generate various types of random alphanumeric codes. The package also includes a Transformer class that you can use to apply some transformations to the generated vouchers. You can use it to generate passwords, pass codes, keys, vouchers, coupons, tickets, tokens etc.

Prerequisites

This package uses PHP 7's random_int() function which generates cryptographic random integers that are suitable for use where unbiased results are critical, such as when shuffling a deck of cards for a poker game.

The sources of randomness used for this function are as follows and if your machine does not provide one of these, you will not be able to use this package.

Installation

Via Composer

This package can be installed easily with composer - just require the amestsantim/voucherator package from the command line.

Alternatively, you can manually add the voucherator package to your composer.json file and then run composer install from the command line as follows:

You can use it in your PHP code like this:

If you are using it in Laravel, you can instantiate an object from the AmestSantim\Voucherator\VoucherGenerator and statically access the methods from the AmestSantim\Voucherator\VoucherTransformer class, if you need to apply transformations on your generated vouchers.

Usage

Documentation

The package is organized very simply. It contains only two classes:

VoucherGenerator

The methods of the VoucherGenerator class can be semantically classified into two:

Mutators

These are the functions that mutate the character set (charSet) from which the vouchers/codes are generated. The default is lower case alphabets, upper case alphabets and numerals. Be mindful that the order in which you apply these function will result in different outcomes.

Action and Related

These function are action functions which tell the object to actually generate the vouchers/codes based on the (possibly previously mutated) character set.

VoucherTransformer

The methods of the VoucherTransformer class are all static and can be used without instantiating an object. They act upon the vouchers/codes after they have been generated by transforming the vouchers in superficial (presentational) ways such as re-formatting and decorating them. All the functions are static and accept and return an array of vouchers.

Contributing

The code follows the PSR-2 coding style guide. It was also written with extensibility in mind. Please feel free to submit a pull request, if you come up with any useful improvements.

Versioning

We use SemVer for versioning. For the versions available, see the tags on this repository.

Authors

License

This project is licensed under the MIT License - see the LICENSE.md file for details

Acknowledgments


All versions of voucherator with dependencies

PHP Build Version
Package Version
Requires php Version ^7.3|^8.0
illuminate/collections Version 8.*
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 amestsantim/voucherator contains the following files

Loading the files please wait ....