<?php

// app/Http/Middleware/SetActiveGuard.php

namespace App\Http\Middleware;

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

class SetActiveGuard
{
    public function handle($request, Closure $next)
    {
        if (session()->has('active_guard')) {
            Auth::shouldUse(session('active_guard'));
        }
        return $next($request);
    }
}
