The GET method is not supported for route /. Supported methods: HEAD.

Getting that error and I'm not sure why or even how to debug this. The laravel.log file has no error. Looking at the debuggar it just shows that error so I have no clue how to debug this.
We get this error when i do: php artisan route:cache If I do this everything works: php artisan route:clear I was told we want to cache the routes though. Any advice on how to debug this?
7 Replies
Dennis Koch
Dennis Koch5mo ago
Is this only Filament routes? Or also Laravel routes?
Fly_Moe
Fly_MoeOP5mo ago
@Dennis Koch Only for Filament. We aren't running any laravel controllers or routes.
Bannakaffalatta
Bannakaffalatta5mo ago
I'm running into this issue as well. It is only an issue on the root / route for the Dashboard, all other routes work fine. Though my set up I'm doing a little weird which I'll try to explain as short as possible. I am upgrading a CMS to use filament locked to the /v2/ folder. The way I have it set up in my vhost for apache is using an Alias such as Alias /v2 /var/www/cms/public while the v1 cms public directory lives at /var/www/cms/www.80/ My initial AdminPanelProvider has it's path('') to allow it to be the root https://cms.test/v2/ When things are not optimized (routes cached), everything works normal. Going to https://cms.test/v2/ filament dashboard loads and all my resources and routes work fine. When I run php artisan optimize, only https://cms.test/v2/ throws this GET not supported only HEAD. If I go to any of the other resources such as https://cms.test/v2/pages it loads and works fine. So it seems only the dashboard route is having the issue. I added /v2/ to the path('v2/'), then optimize (cache routes) and it loads the dashboard at https://cms.test/v2 and https://cms.test/v2/v2/ though all the resources are now accessed at https://cms.test/v2/v2/pages Cached routes seem to include both GET/HEAD so not sure where it's looking for /
'/' =>
array (
0 =>
array (
0 =>
array (
'_route' => 'filament.admin.pages.dashboard',
),
1 => NULL,
2 =>
array (
'GET' => 0,
'HEAD' => 1,
),
3 => NULL,
4 => false,
5 => false,
6 => NULL,
),
),
'/' =>
array (
0 =>
array (
0 =>
array (
'_route' => 'filament.admin.pages.dashboard',
),
1 => NULL,
2 =>
array (
'GET' => 0,
'HEAD' => 1,
),
3 => NULL,
4 => false,
5 => false,
6 => NULL,
),
),
Dennis Koch
Dennis Koch5mo ago
Feels like it should be ->path('/') but the APP_URL should include /v2
Bannakaffalatta
Bannakaffalatta5mo ago
No luck. I'm gonna set up a vanilla app with docker environment to see if I can replicate it with very minimal
Bannakaffalatta
Bannakaffalatta5mo ago
I created a bare minimum filament-issue repo with a docker mimicing the environment to cause the issue. Steps to reproduce. https://github.com/waynestate/filament-issue?tab=readme-ov-file#issue
GitHub
GitHub - waynestate/filament-issue
Contribute to waynestate/filament-issue development by creating an account on GitHub.
Bannakaffalatta
Bannakaffalatta5mo ago
Started an issue with it as well, if it helps. https://github.com/filamentphp/filament/issues/13649
GitHub
Using ->path('/') with Apache alias causes Method Not Allowed e...
Package filament/filament Package Version v3.2.95 Laravel Version v11.16.0 Livewire Version v3.5.4 PHP Version PHP 8.2.20 Problem description Apache mod_alias is being used to alias /v2 to the Fila...
Want results from more Discord servers?
Add your server