<?php

namespace LaraBB\User\UI\Web\Handlers;

use App\Http\Controllers\Controller;
use Illuminate\Http\RedirectResponse;
use LaraBB\User\UI\Web\Requests\Logout;

/**
 * Class LogoutHandler
 * @package LaraBB\User\UI\Web\Handlers
 */
class LogoutHandler extends Controller
{
    /**
     * @param Logout $request
     * @return RedirectResponse
     */
    public function __invoke(Logout $request): RedirectResponse
    {
        auth()->logout();

        return $request->success();
    }
}
