Back | Home
الـ Path الحالي: /home/picotech/domains/instantly.picotech.app/public_html/public/uploads/../../app/Http/Middleware
الملفات الموجودة في هذا الـ Path:
.
..
Authenticate.php
EmailVerify.php
EncryptCookies.php
PreventRequestsDuringMaintenance.php
RedirectIfAuthenticated.php
TrimStrings.php
TrustHosts.php
TrustProxies.php
ValidateSignature.php
VerifyCsrfToken.php

مشاهدة ملف: EmailVerify.php

<?php

namespace App\Http\Middleware;

use Closure;

class EmailVerify
{
    /**
     * Handle an incoming request.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  \Closure  $next
     * @return mixed
     */
    public function handle($request, Closure $next,$guard = null)
    {
        if($guard=='customer' && auth('customer')->check() && !auth('customer')->user()->email_verified_at){
          auth($guard)->logout();
          return redirect()->route('login')->with('fail','Email has not verified yet. Please verify email before login');
        }
        return $next($request);
    }
}