24 lines
386 B
PHP

<?php
declare(strict_types=1);
namespace App\Livewire\Actions;
use Illuminate\Support\Facades\{Auth, Session};
final class Logout
{
/**
* Log the current user out of the application.
*/
public function __invoke()
{
Auth::guard('web')->logout();
Session::invalidate();
Session::regenerateToken();
return redirect('/');
}
}