I have a logout form, this goes to the route in web.php, in the controller I have a logout method there is a code to move to the home page, but the error 404 not found appears
public function logout()
{
Auth::logout();
request()->session()->invalidate();
request()->session()->regenerateToken();
return redirect('/');
}
Route::get('/', [PostController::class, 'home']);
<form action="post" action="/logout">
@csrf
<button class="dropdown-item" type="submit"><i class="bi bi-box-arrow-right"></i> Logout</button>
</form>
I tried
php artisan cache:clear
but it still has an error, I hope someone can help me
New contributor
ZAKI ULUMUDIN is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.