<?php

namespace App\Support;

use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;

final class PortalSession
{
    public function terminate(Request $request): void
    {
        $locale = app()->getLocale();
        Auth::guard('web')->logout();
        $request->session()->regenerate();
        $request->session()->regenerateToken();
        $request->session()->put('locale', $locale);
    }
}
