Download the PHP package khaleds/voucher without Composer

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

enter image description here

Laravel Voucher Package

Coupons and voucher codes checker. you can create voucher with many conditions that fit your business.

Available Conditions

column description
code coupon or voucher code
is_available check if this voucher available or not
max_uses the max number of using this voucher
max_uses_user the max number of using this voucher per single user
starts_at start date for this voucher to be published
expires_at end date for this voucher to be closed

all of this conditions the package checking it .

what about you have a coupon for a specific users ,vendors or customers beside the other conditions ofcourse , or even i need to apply coupon for category , service or products all of them or specific ones ?

voucher_implementation_id ;) this forigen id related with table takes [class path,value as json]. you can add your voucher audience as a morph table in voucher_audiences that tacks which usable_type as a table name, usable_id as model id ,is_all bool that mean all records in this table and voucher_id . in the voucher_implementations table you can find the implementation record for each voucher the default one is applied . the default implementation just check for model table ,id or is_all check in voucher_audiences table

List of content

Installation

composer require khaleds/voucher

Migrate table

php artisan make:migration

Seeder

Add this to your DatabaseSeeder class in run method

How Does It Work?

Vouchers table

This table contain the voucher conditions like column description
code coupon or voucher code
is_available check if this voucher available or not
max_uses the max number of using this voucher
max_uses_user the max number of using this voucher per single user
starts_at start date for this voucher to be published
expires_at end date for this voucher to be closed
Other columns column description
discount_amount The amount to discount
is_fixed Whether or not the "discount_amount" is a percentage or a fixed price
max_uses Number of users that use this voucher
amount_cap Amount to apply it if the price greater than cap
uses The total number of uses for this voucher

If you want more condition like specific models or ids like i want this voucher for all accounts table or users table or the users with some ids you can do that in this table

Vouchers Audiences table

This table contain column description
usable_type Table name
usable_id The id that you want to use voucher
voucher_id The voucher that you want to apply this condition on it
is_all If you want to make all users in this table can use the voucher

the relation is one to many so you can add many ids if you want per voucher

User Voucher table

This table contain the users that applied to the voucher added when you use function apply

How to use

you have 2 static classes

If you want to avoid all checks and apply the voucher

Advanced use

what about you have an extra conditions like you want to add voucher with only country ,service , products or categories

Using

you just need to add your audiences in Vouchers Audiences table

if you want to overwrite the implementation class change the class path in voucher_implementations table and extend from DefaultVoucher class


All versions of voucher with dependencies

PHP Build Version
Package Version
No informations.
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 khaleds/voucher contains the following files

Loading the files please wait ....