Laravel 11 New a Health Check Route Example
In this short article, we will show you a new health check endpoint in laravel 11 framework.
The release of Laravel 11 is around the corner and it is packed with a lot of new features and improvements. Laravel 11 comes with a slimmer application skeleton. Laravel 11 introduce streamlined application structure, per-second rate limiting, health routing etc.
With the launch of Laravel 11, fresh applications now come equipped with a health `/up` endpoint. This endpoint is established within the updated `bootstrap/app.php` file, incorporating the default `health` parameter integrated into the Laravel 11 skeleton.
bootstrap/app.php
<?php
use Illuminate\Foundation\Application;
use Illuminate\Foundation\Configuration\Exceptions;
use Illuminate\Foundation\Configuration\Middleware;
return Application::configure(basePath: dirname(__DIR__))
->withRouting(
web: __DIR__.'/../routes/web.php',
commands: __DIR__.'/../routes/console.php',
health: '/up',
)
->withMiddleware(function (Middleware $middleware) {
//
})
->withExceptions(function (Exceptions $exceptions) {
//
})->create();
During the setup of application routing, the Laravel framework establishes the health route.
You can run your app and open the following URL:
http://localhost:8000/up
You will see the following output:
I hope it can help you...
Hardik Savani
I'm a full-stack developer, entrepreneur and owner of ItSolutionstuff.com. I live in India and I love to write tutorials and tips that can help to other artisan. I am a big fan of PHP, Laravel, Angular, Vue, Node, Javascript, JQuery, Codeigniter and Bootstrap from the early stage. I believe in Hardworking and Consistency.
We are Recommending you
- How to Publish Broadcasting Channels Route File in Laravel 11?
- How to Create and Use Traits in Laravel 11?
- How to use new Dumpable Trait in Laravel 11?
- How to Publish API Route File in Laravel 11?
- How to Create and Use Enum in Laravel 11?
- How to Publish Config Files in Laravel 11?
- How to Create Interface in Laravel 11?
- How to Create Custom Class in Laravel 11?
- How to Publish the lang Folder in Laravel 11?
- What’s New in Laravel 11: New Features and Latest Updates
- How to Install Laravel 11 Application?
- How to Remove Public from URL in Laravel 10?
- How to Create Custom Middleware in Laravel?