share-lt/app/Livewire/Actions/Logout.php
Jon Brookes 10baf3315e feat/add-laravel (#1)
adding laravel 12

Co-authored-by: jon brookes <marshyon@gmail.com>
Reviewed-on: https://codeberg.org/headshed/share-lt/pulls/1
2026-01-01 18:30:31 +01:00

22 lines
383 B
PHP

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