Health endpoint is stripped out when defining routes with "using" keywork #55776
Replies: 3 comments
-
That is expected, as per docs:
Reference: https://laravel.com/docs/12.x/routing#routing-customization Apart from |
Beta Was this translation helpful? Give feedback.
-
@rodrigopedra , thanks for finding that piece of documentation. I acknowledge that documentation is clear in that sense. However, the interface of It might be that the health check endpoint is intended as an exception to the rule. Let’s wait for @taylorotwell 's input to see if that was the intended design. I've also created a pull request with a potential solution in case it's decided to treat health as a special case while maintaining consistency with the using approach. |
Beta Was this translation helpful? Give feedback.
-
IMHO, there is no ambiguity, as long one has read the docs. But I also agree it would be a nice addition to allow registering the health route along with the Fingers crossed! |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Laravel Version
12.x
PHP Version
8.4
Database Driver & Version
No response
Description
Laravel comes with a built-in health check endpoint on
/up
, which is defined in thebootstrap/app.php
file as an argument of thewithRouting
method. In specific circumstances, this endpoint is stripped out, in particular, when routes are defined utilizing the "using" parameter as an alternative to "web".Current Behaviour
When running
php artisan route:list
in a fresh Laravel app, you get something similar to the followingWhen defining routes with the "using" parameter, the health check endpoint is removed from the routes, as we can observe by executing the route list again.
Expected Behaviour
The health check endpoint is perverse regardless of the way routes are defined, either utilizing
web
orusing
as an argument forwithRouting
.Steps To Reproduce
Application::configure(...)->withRouting(...)
block:php artisan route:list
and confirm the presence of the /up health check route.php artisan route:list
again.Beta Was this translation helpful? Give feedback.
All reactions