File "EnsureKycIsCompleted.php"

Full Path: /home/fundopuh/trader.fxex.org/app/Http/Middleware/EnsureKycIsCompleted.php
File size: 871 bytes
MIME-type: text/x-php
Charset: utf-8

<?php  
// this Code is Cracked by dharunMods-YouTube-Channel

namespace App\Http\Middleware;

use App\Models\Settings;
use Closure;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;

class EnsureKycIsCompleted
{
    /**
     * 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)
    {
        $user = Auth::user();
        $settings = Settings::find(1);
        if ($settings->enable_kyc_registration == 'yes' and $user->account_verify != 'Verified') {
           return redirect()->route('account.verify');
        }
        return $next($request);
    }
}