spatie/laravel-health
Monitor your Laravel app’s health by registering checks (disk space, etc.) with warning/fail thresholds. Get notified via mail or Slack when checks degrade, and extend with custom checks for proactive alerting.
meilisearch.md
This check will verify if Meilisearch is running. It will call Meilisearch's built-in health endpoint and verify that its status returns available.
Here's how you can register the check.
use Spatie\Health\Facades\Health;
use Spatie\Health\Checks\Checks\MeilisearchCheck;
Health::checks([
MeilisearchCheck::new(),
]);
By default, the check will try to get a response from "https://127.0.0.1:7700/health".
You can use url() method to change that url.
use Spatie\Health\Facades\Health;
use Spatie\Health\Checks\Checks\MeilisearchCheck;
Health::checks([
MeilisearchCheck::new()->url("https://your-custom-url:1234/custom-endpoint"),
]);
By default, the check has a timeout of 1 second.
You can use timeout() to set the maximum number of seconds the HTTP request should run for before it fails.
use Spatie\Health\Facades\Health;
use Spatie\Health\Checks\Checks\MeilisearchCheck;
Health::checks([
MeilisearchCheck::new()->timeout(2),
]);
You can use token() to add an authorization header to the request.
use Spatie\Health\Facades\Health;
use Spatie\Health\Checks\Checks\MeilisearchCheck;
Health::checks([
MeilisearchCheck::new()->token('auth-token'),
]);
How can I help you explore Laravel packages today?