<?php
namespace App\Http\Middleware\Admin;
use Closure;
use Illuminate\Http\Request;
use Illuminate\Validation\ValidationException;
class AppModeGuard
{
/**
* Handle an incoming request.
*
* @param \Illuminate\Http\Request $request
* @param \Closure(\Illuminate\Http\Request): (\Illuminate\Http\Response|\Illuminate\Http\RedirectResponse) $next
* @return \Illuminate\Http\Response|\Illuminate\Http\RedirectResponse
*/
public function handle(Request $request, Closure $next)
{
if(in_array($request->method(),['POST','PUT','DELETE'])) {
$ignore_routes = ['logout'];
$request_path = $request->path();
$request_path = explode('?',$request_path);
$request_path = array_shift($request_path);
$request_path = explode("/",$request_path);
$request_path = array_pop($request_path);
if(!in_array($request_path,$ignore_routes)) {
if(env("APP_MODE") != 'live') {
throw ValidationException::withMessages([
'unknown' => 'Can\'t change anything for demo application.',
]);
}
}
}
return $next($request);
}
}
How To Payment
Making a payment on our website is quick and secure. Start by logging in or creating an account. Select your preferred payment method, input the required details, and review the information. Once you confirm everything is correct, click on the "Submit Payment" button. You’ll receive instant confirmation and can track your payment status through your account dashboard. It’s an easy and secure process.