{"id":126,"date":"2024-02-20T07:29:00","date_gmt":"2024-02-20T07:29:00","guid":{"rendered":"https:\/\/emka.web.id\/tutorial\/2024\/02\/20\/laravel-11-masukkan-fitur-health-check-endpoint\/"},"modified":"2024-02-20T07:29:00","modified_gmt":"2024-02-20T07:29:00","slug":"laravel-11-masukkan-fitur-health-check-endpoint","status":"publish","type":"post","link":"https:\/\/emka.web.id\/en\/2024\/02\/laravel-11-masukkan-fitur-health-check-endpoint.html","title":{"rendered":"Laravel 11 Masukkan Fitur Health Check Endpoint"},"content":{"rendered":"<div style=\"clear: both;text-align: center\"><a href=\"https:\/\/blogger.googleusercontent.com\/img\/b\/R29vZ2xl\/AVvXsEi9R_MRnVWGhaKkFvqqZNtLnQViQoqW-pnqBlFR6EzDmlnJdWzEKJAfhE550wltp0W-syQkrbE-fIpHkZqm3H86tdPIzhrFeupLVoJOSzlOTPb786N9DLF5fsRCNMirsb6sGyQvNQya86ISkoPEhrmN1yrKq_qO0Cvmbw4-sLhZugHZmGPA0jUSnroFPTU\/s2200\/laravel-10-featured.webp\" style=\"margin-left: 1em;margin-right: 1em\"><img loading=\"lazy\" decoding=\"async\" border=\"0\" data-original-height=\"1100\" data-original-width=\"2200\" height=\"160\" src=\"https:\/\/blogger.googleusercontent.com\/img\/b\/R29vZ2xl\/AVvXsEi9R_MRnVWGhaKkFvqqZNtLnQViQoqW-pnqBlFR6EzDmlnJdWzEKJAfhE550wltp0W-syQkrbE-fIpHkZqm3H86tdPIzhrFeupLVoJOSzlOTPb786N9DLF5fsRCNMirsb6sGyQvNQya86ISkoPEhrmN1yrKq_qO0Cvmbw4-sLhZugHZmGPA0jUSnroFPTU\/s320\/laravel-10-featured.webp\" width=\"320\" \/><\/a><\/div>\n<p>Sebagai bagian dari rilis Laravel 11, aplikasi baru termasuk ujung \/up kesehatan. Rute ini didefinisikan dalam file <i><u>bootstrap\/app.php<\/u><\/i> baru dengan melewati parameter kesehatan\u2014yang sudah didefinisikan secara default dalam kerangka Laravel 11:<\/p>\n<pre>Application::configure(basePath: dirname(__DIR__))\n    -&gt;withProviders()\n    -&gt;withRouting(\n        web: __DIR__.'\/..\/routes\/web.php',\n        \/\/ api: __DIR__.'\/..\/routes\/api.php',\n        commands: __DIR__.'\/..\/routes\/console.php',\n        \/\/ channels: __DIR__.'\/..\/routes\/channels.php',\n        health: '\/up', \n    )\n<\/pre>\n<p>Ketika mengatur rute aplikasi, kerangka Laravel mendefinisikan rute kesehatan dan juga mengirimkan sebuah acara <b>DiagnosingHealth<\/b>:<span><a name=\"more\"><\/a><\/span><\/p>\n<pre>use IlluminateFoundationEventsDiagnosingHealth;\n \n\/\/ ...\n \nif (is_string($health)) {\n    Route::middleware('web')-&gt;get($health, function () {\n        Event::dispatch(new DiagnosingHealth);\n \n        return View::file(__DIR__.'\/..\/resources\/health-up.blade.php');\n    });\n}\n<\/pre>\n<p>Rute ini dapat dikonfigurasi dengan endpoint default \/up dan mengembalikan halaman kesehatan &#8220;Aplikasi aktif&#8221; yang dianimasikan dalam peramban:<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Sebagai bagian dari rilis Laravel 11, aplikasi baru termasuk ujung \/up kesehatan. Rute ini didefinisikan dalam file bootstrap\/app.php baru dengan melewati parameter kesehatan\u2014yang sudah&#8230;<\/p>\n","protected":false},"author":27,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-126","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/emka.web.id\/en\/wp-json\/wp\/v2\/posts\/126","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/emka.web.id\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/emka.web.id\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/emka.web.id\/en\/wp-json\/wp\/v2\/users\/27"}],"replies":[{"embeddable":true,"href":"https:\/\/emka.web.id\/en\/wp-json\/wp\/v2\/comments?post=126"}],"version-history":[{"count":0,"href":"https:\/\/emka.web.id\/en\/wp-json\/wp\/v2\/posts\/126\/revisions"}],"wp:attachment":[{"href":"https:\/\/emka.web.id\/en\/wp-json\/wp\/v2\/media?parent=126"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/emka.web.id\/en\/wp-json\/wp\/v2\/categories?post=126"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/emka.web.id\/en\/wp-json\/wp\/v2\/tags?post=126"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}