Logout.php 358 B

1234567891011121314151617181920
  1. <?php
  2. namespace App\Livewire\Actions;
  3. use Illuminate\Support\Facades\Auth;
  4. use Illuminate\Support\Facades\Session;
  5. class Logout
  6. {
  7. /**
  8. * Log the current user out of the application.
  9. */
  10. public function __invoke(): void
  11. {
  12. Auth::guard('web')->logout();
  13. Session::invalidate();
  14. Session::regenerateToken();
  15. }
  16. }