ItSolutionStuff.com

Laravel 11 New a Health Check Route Example

By Hardik Savani β€’ September 4, 2024
Laravel

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

Hardik Savani

I'm a full-stack developer, entrepreneur, and founder of ItSolutionStuff.com. Passionate about PHP, Laravel, JavaScript, and helping developers grow.

πŸ“Ί Subscribe on YouTube

We Are Recommending You

β˜…

How to Publish Broadcasting Channels Route File in Laravel 11?

Read Now β†’
β˜…

How to Create and Use Traits in Laravel 11?

Read Now β†’
β˜…

How to use new Dumpable Trait in Laravel 11?

Read Now β†’
β˜…

How to Publish API Route File in Laravel 11?

Read Now β†’
β˜…

How to Create and Use Enum in Laravel 11?

Read Now β†’
β˜…

How to Publish Config Files in Laravel 11?

Read Now β†’
β˜…

How to Create Interface in Laravel 11?

Read Now β†’
β˜…

How to Create Custom Class in Laravel 11?

Read Now β†’
β˜…

How to Publish the lang Folder in Laravel 11?

Read Now β†’
β˜…

What’s New in Laravel 11: New Features and Latest Updates

Read Now β†’
β˜…

How to Install Laravel 11 Application?

Read Now β†’
β˜…

How to Remove Public from URL in Laravel 10?

Read Now β†’
β˜…

How to Create Custom Middleware in Laravel?

Read Now β†’