Laravel Version
12.24
PHP Version
8.4.8
Database Driver & Version
PostgreSQL
Description
In the main html folder i have a symbolic link "api" linked to "public" laravel folder. This because in the main html folder i have the compiled angular UI.
I have a route based on the base API URL (apiPrefix = ''): Route::get('/', ...)
If I use route:cache, the Request URL in the CompiledRouteCollection is cleaned of / via requestWithoutTrailingSlash. This causes the API to return: The GET method is not supported for route /.
Without route:cache, it works.
Steps To Reproduce
Steps To Reproduce
Run php artisan route:cache
Open a web browser locally with a URL that includes a subpath, using one of the following methods:
http://localhost/bug-report/public/
or
Create a symlink named api pointing to the public Laravel folder, then open http://localhost/api/ (my case)
The important thing is that there is a subpath in the URL.
I created this repository https://github.com/marzoli/bug-report with your instructions.
I also changed Readme.md with instructions to reproduce