<?php

namespace App\Merchant\Middleware;

use Closure;
use Illuminate\Support\Facades\Auth;

class Guest
{
    public function handle($request, Closure $next, $guard = null)
    {
        if (Auth::guard('merchant')->check()) {
            return redirect()->route('merchant.index');
        }

        return $next($request);
    }
}
