1. Go to this page and download the library: Download a4anthony/coupon library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
public function handle($request, Closure $next, $guard = null)
{
if (Auth::guard($guard)->check()) {
if ($guard == "admin") {
return redirect()->route('coupon.dashboard');
}
return redirect(RouteServiceProvider::HOME);
}
return $next($request);
}
/*
|--------------------------------------------------------------------------
| Timezone
|--------------------------------------------------------------------------
|
| Here you can specify the coupon genrator timezone
|
*/
'timezone' => 'Africa/Lagos',
/*
|--------------------------------------------------------------------------
| Currency
|--------------------------------------------------------------------------
|
| Here you can specify the coupon genrator currency
|
*/
'currency' => 'NGN',
/*
|--------------------------------------------------------------------------
| Currency Codes
|--------------------------------------------------------------------------
|
| Here you can specify the coupon genrator currency codes
|
*/
'currency_code' => [
'NGN' => '₦',
'USD' => '$',
'EUR' => '€',
'GBP' => '£',
],
/*
|--------------------------------------------------------------------------
| Error Messages
|--------------------------------------------------------------------------
|
| Here you can specify the coupon genrator error messages
|
*/
'error_msgs' => [
'not_exist' => 'coupon does not exist',
'not_valid' => 'coupon is not valid',
'used' => 'coupon is already used by you',
'exceeds' => 'coupon discount value is greater than amount',
]