Current File : /home/tradevaly/public_html/app/Http/Middleware/AccountVerification.php
<?php

namespace App\Http\Middleware;

use Illuminate\Http\Request;
use Closure;
use Auth;
class AccountVerification
{
    /**
     * Get the path the user should be redirected to when they are not authenticated.
     *
     * @param  \Illuminate\Http\Request  $request
     * @return string|null
     */
    public function handle(Request $request, Closure $next)
    {
        if (Auth::check() && Auth::user()->email_verified_at != null ) {
            return  $next($request);
        }
        else{
            return redirect()->route('front.user.verify');
          
        }
    }
}