<?php

namespace Modules\Auth\Controllers;

use App\Controllers\BaseController;
use Modules\Auth\Services\AuthService;

class LogoutController extends BaseController
{
    public function index()
    {
        (new AuthService())->logout();

        return redirect()->to(config('Auth')->loginUrl)->with('success', 'You have been logged out.');
    }
}
