Download the PHP package a4anthony/coupon without Composer
On this page you can find all versions of the php package a4anthony/coupon. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package coupon
Coupon Generator for Laravel
Installation Steps
1. Require the package
After creating your new Laravel application you can include the coupon package with the following command:
2. Add the DB Credentials & APP_URL
Next make sure to create a new database and add your database credentials to your .env file:
You will also want to update your website URL inside of the APP_URL
variable inside the .env file:
3. Install coupon generator
Lastly, we can install the coupon generator. You can do this either with or without dummy data. The dummy data will include 1 admin account (if no users already exists) and 5 test coupons
To install the coupon generator without dummy simply run
If you prefer installing it with dummy run
If you encounter any issues with the installation, run the code below to autoload all classes and retry the installation
And we're all good to go!
Start up a local development server with php artisan serve
And, visit http://localhost:8000/coupon/dashboard.
Creating an Admin User
If you did go ahead with the dummy data, a user should have been created for you with the following login credentials:
email:
[email protected]
password:password
If you did not install the dummy data and you wish to create a new admin user you can pass the --create
flag, like so:
And you will be prompted for the user's name and password.
4. Register custom guards for the coupon generator
Go to the the config folder and open the auth.php file. In the providers array, include the code below
In the same file, in the guards array, include the code below
5. Adjust the RedirectIfAuthenticated class to recognize custom guard
Go to app/Http/Middleware/RedirectIfAuthenticated.php and edit the handle() method to the code below:
6. Register the custom middleware class
app/Http/Middleware/RedirectIfAuthenticated.php and include the code below in the $routeMiddleware array
Configuring package
Package can configured in the config/coupon.php file. You can configure timezone, change currency and include currency symbol and also set your error messages.
Usage
Include the package with:
1. Validate coupon and get discount value
2. Callback on successful payment
ENJOY!!!
Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.
License
All versions of coupon with dependencies
doctrine/dbal Version ^2.5
larapack/doctrine-support Version ~0.1.4
laravel/ui Version >=1.0
ext-json Version *