Logout error.
The GET method is not supported for route admin/logout. Supported methods: POST.
Laravel: 11
Breeze + Livewire
Filament 3.2
Does any one experience this issue. Do I have to create my own logout class?
#logout #laravel11
![No description](https://answer-overflow-discord-attachments.s3.amazonaws.com/1231472887781785660/image.png)
Solution:Jump to solution
got solution how, form calling to http: while the host is https: I have to put URL::forceScheme('https'); to make it works
4 Replies
![No description](https://answer-overflow-discord-attachments.s3.amazonaws.com/1231488932970102874/image.png)
form has method=post correctly, but why does not work. very strange.
![No description](https://answer-overflow-discord-attachments.s3.amazonaws.com/1231489193503494174/image.png)
Solution
got solution how, form calling to http: while the host is https: I have to put URL::forceScheme('https'); to make it works
Sorry, this is not seems to be a good answer. I found that after forcing https the spa mode no longer works.
I had to use my custom UserMenuItem for logout like this. I don't quite like it. ->userMenuItems([
'logout' => MenuItem::make()->label('Logout')->url(fn (): string =>
Route::post('admin/logout', Logout::class, ['_token' => csrf_token()])->uri()),
])
got if fixed now with this
$this->app['request']->server->set('HTTPS','on'); // Pagination Links support HTTPS
URL::forceScheme('https');