Admin Logout Option
En resources/views/admin/body/header.blade.php:
<li class="dropdown-item py-2">
<a href="{{ route('admin.logout') }}" class="text-body ms-0">
<i class="me-2 icon-md" data-feather="log-out"></i>
<span>Log Out</span>
</a>
</li>
En routes/web.php:
Route::get('/admin/logout', [AdminController::class, 'AdminLogout'])->name('admin.logout');
En app/Http/Controllers/AdminController.php:
use Illuminate\Support\Facades\Auth;
// Admin Logout
public function AdminLogout(Request $request){
Auth::guard('web')->logout();
$request->session()->invalidate();
$request->session()->regenerateToken();
return redirect('/login');
}