From cf40c7e46de46c128e0b060d2078aae7b484f155 Mon Sep 17 00:00:00 2001 From: Dan Lemon Date: Fri, 13 Mar 2026 14:27:15 +0100 Subject: [PATCH] chore: add health check --- composer.json | 4 +- composer.lock | 508 ++++++++++++++++++++++++++++++++++++++++++++- routes/console.php | 4 + 3 files changed, 514 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index 9f6a482e..30c07997 100644 --- a/composer.json +++ b/composer.json @@ -24,7 +24,9 @@ "laravel/sanctum": "^4.0", "laravel/tinker": "^2.9", "phpseclib/phpseclib": "^3.0", - "spatie/mjml-php": "^1.2" + "spatie/laravel-health": "^1.39", + "spatie/mjml-php": "^1.2", + "spatie/security-advisories-health-check": "^1.3" }, "require-dev": { "fakerphp/faker": "^1.23", diff --git a/composer.lock b/composer.lock index 619a6b2e..7b330d77 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "2b6342ce3c11cc91087fd3c28bfc7d71", + "content-hash": "71bf34401628cefd1c8e63268306c6f3", "packages": [ { "name": "amazeeio/lagoon-logs", @@ -451,6 +451,83 @@ ], "time": "2024-02-09T16:56:22+00:00" }, + { + "name": "composer/semver", + "version": "3.4.4", + "source": { + "type": "git", + "url": "https://github.com/composer/semver.git", + "reference": "198166618906cb2de69b95d7d47e5fa8aa1b2b95" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/semver/zipball/198166618906cb2de69b95d7d47e5fa8aa1b2b95", + "reference": "198166618906cb2de69b95d7d47e5fa8aa1b2b95", + "shasum": "" + }, + "require": { + "php": "^5.3.2 || ^7.0 || ^8.0" + }, + "require-dev": { + "phpstan/phpstan": "^1.11", + "symfony/phpunit-bridge": "^3 || ^7" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.x-dev" + } + }, + "autoload": { + "psr-4": { + "Composer\\Semver\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nils Adermann", + "email": "naderman@naderman.de", + "homepage": "http://www.naderman.de" + }, + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" + }, + { + "name": "Rob Bast", + "email": "rob.bast@gmail.com", + "homepage": "http://robbast.nl" + } + ], + "description": "Semver library that offers utilities, version constraint parsing and validation.", + "keywords": [ + "semantic", + "semver", + "validation", + "versioning" + ], + "support": { + "irc": "ircs://irc.libera.chat:6697/composer", + "issues": "https://github.com/composer/semver/issues", + "source": "https://github.com/composer/semver/tree/3.4.4" + }, + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" + }, + { + "url": "https://github.com/composer", + "type": "github" + } + ], + "time": "2025-08-20T19:15:30+00:00" + }, { "name": "cuyz/valinor", "version": "2.3.2", @@ -5713,6 +5790,82 @@ ], "time": "2025-02-10T09:22:41+00:00" }, + { + "name": "spatie/enum", + "version": "3.13.0", + "source": { + "type": "git", + "url": "https://github.com/spatie/enum.git", + "reference": "f1a0f464ba909491a53e60a955ce84ad7cd93a2c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/spatie/enum/zipball/f1a0f464ba909491a53e60a955ce84ad7cd93a2c", + "reference": "f1a0f464ba909491a53e60a955ce84ad7cd93a2c", + "shasum": "" + }, + "require": { + "ext-json": "*", + "php": "^8.0" + }, + "require-dev": { + "fakerphp/faker": "^1.9.1", + "larapack/dd": "^1.1", + "phpunit/phpunit": "^9.0", + "vimeo/psalm": "^4.3" + }, + "suggest": { + "fakerphp/faker": "To use the enum faker provider", + "phpunit/phpunit": "To use the enum assertions" + }, + "type": "library", + "autoload": { + "psr-4": { + "Spatie\\Enum\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Brent Roose", + "email": "brent@spatie.be", + "homepage": "https://spatie.be", + "role": "Developer" + }, + { + "name": "Tom Witkowski", + "email": "dev@gummibeer.de", + "homepage": "https://gummibeer.de", + "role": "Developer" + } + ], + "description": "PHP Enums", + "homepage": "https://github.com/spatie/enum", + "keywords": [ + "enum", + "enumerable", + "spatie" + ], + "support": { + "docs": "https://docs.spatie.be/enum", + "issues": "https://github.com/spatie/enum/issues", + "source": "https://github.com/spatie/enum" + }, + "funding": [ + { + "url": "https://spatie.be/open-source/support-us", + "type": "custom" + }, + { + "url": "https://github.com/spatie", + "type": "github" + } + ], + "time": "2022-04-22T08:51:55+00:00" + }, { "name": "spatie/invade", "version": "2.1.0", @@ -5772,6 +5925,98 @@ ], "time": "2024-05-17T09:06:10+00:00" }, + { + "name": "spatie/laravel-health", + "version": "1.39.0", + "source": { + "type": "git", + "url": "https://github.com/spatie/laravel-health.git", + "reference": "ef13e7249adee21e42d71b05f93c61ecf49326df" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/spatie/laravel-health/zipball/ef13e7249adee21e42d71b05f93c61ecf49326df", + "reference": "ef13e7249adee21e42d71b05f93c61ecf49326df", + "shasum": "" + }, + "require": { + "dragonmantank/cron-expression": "^3.3.1", + "guzzlehttp/guzzle": "^6.5|^7.4.5|^7.2", + "illuminate/console": "^11.0|^12.0|^13.0", + "illuminate/contracts": "^11.0|^12.0|^13.0", + "illuminate/database": "^11.0|^12.0|^13.0", + "illuminate/notifications": "^11.0|^12.0|^13.0", + "illuminate/support": "^11.0|^12.0|^13.0", + "laravel/serializable-closure": "^1.3|^2.0", + "nunomaduro/termwind": "^1.0|^2.0", + "php": "^8.2", + "spatie/enum": "^3.13", + "spatie/laravel-package-tools": "^1.12.1", + "spatie/regex": "^3.1.1|^3.1", + "spatie/temporary-directory": "^2.2", + "symfony/process": "^5.4|^6.0|^7.0|^8.0" + }, + "require-dev": { + "laravel/horizon": "^5.9.10", + "nunomaduro/collision": "^5.10|^6.2.1|^6.1|^8.0", + "orchestra/testbench": "^9.0|^10.0|^11.0", + "pestphp/pest": "^2.34|^3.0|^4.0", + "pestphp/pest-plugin-laravel": "^2.3|^3.0|^4.0", + "phpstan/extension-installer": "^1.1", + "phpstan/phpstan-deprecation-rules": "^1.0|^2.0", + "phpstan/phpstan-phpunit": "^1.1.1|^2.0", + "phpunit/phpunit": "^9.5.21|^9.5.10|^10.5|^11.0|^12.0", + "spatie/laravel-ray": "^1.30", + "spatie/pest-plugin-snapshots": "^1.1|^2.3|^3.0", + "spatie/pest-plugin-test-time": "^1.1.1|^1.1|^2.0|^3.0", + "spatie/test-time": "^1.3|^2.0" + }, + "type": "library", + "extra": { + "laravel": { + "aliases": { + "Health": "Spatie\\Health\\Facades\\Health" + }, + "providers": [ + "Spatie\\Health\\HealthServiceProvider" + ] + } + }, + "autoload": { + "psr-4": { + "Spatie\\Health\\": "src", + "Spatie\\Health\\Database\\Factories\\": "database/factories" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Freek Van der Herten", + "email": "freek@spatie.be", + "role": "Developer" + } + ], + "description": "Monitor the health of a Laravel application", + "homepage": "https://github.com/spatie/laravel-health", + "keywords": [ + "laravel", + "laravel-health", + "spatie" + ], + "support": { + "source": "https://github.com/spatie/laravel-health/tree/1.39.0" + }, + "funding": [ + { + "url": "https://github.com/spatie", + "type": "github" + } + ], + "time": "2026-03-01T12:56:10+00:00" + }, { "name": "spatie/laravel-package-tools", "version": "1.92.7", @@ -5894,6 +6139,206 @@ ], "time": "2026-02-09T15:00:49+00:00" }, + { + "name": "spatie/packagist-api", + "version": "2.1.1", + "source": { + "type": "git", + "url": "https://github.com/spatie/packagist-api.git", + "reference": "0ce5b849df19338f44902008ebc1f9e9e166a1b6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/spatie/packagist-api/zipball/0ce5b849df19338f44902008ebc1f9e9e166a1b6", + "reference": "0ce5b849df19338f44902008ebc1f9e9e166a1b6", + "shasum": "" + }, + "require": { + "composer/semver": "^3.0", + "ext-json": "*", + "guzzlehttp/guzzle": "^7.0", + "php": "^8.2" + }, + "require-dev": { + "laravel/pint": "^1.17.3", + "phpunit/phpunit": "^11.5 || ^12.0", + "spatie/phpunit-snapshot-assertions": "^5.1" + }, + "type": "library", + "autoload": { + "psr-4": { + "Spatie\\Packagist\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Freek Van der Herten", + "email": "freek@spatie.be", + "homepage": "https://spatie.be", + "role": "Developer" + }, + { + "name": "Jolita Grazyte", + "email": "jolita@spatie.be", + "homepage": "https://spatie.be", + "role": "Developer" + }, + { + "name": "Mark Walet", + "homepage": "https://markwalet.me", + "role": "Developer" + } + ], + "description": "Fetch package info from Packagist", + "homepage": "https://github.com/spatie/packagist-api", + "keywords": [ + "api", + "packagist", + "spatie" + ], + "support": { + "source": "https://github.com/spatie/packagist-api/tree/2.1.1" + }, + "funding": [ + { + "url": "https://spatie.be/open-source/support-us", + "type": "custom" + }, + { + "url": "https://github.com/spatie", + "type": "github" + } + ], + "time": "2025-03-21T09:22:04+00:00" + }, + { + "name": "spatie/regex", + "version": "3.1.1", + "source": { + "type": "git", + "url": "https://github.com/spatie/regex.git", + "reference": "d543de2019a0068e7b80da0ba24f1c51c7469303" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/spatie/regex/zipball/d543de2019a0068e7b80da0ba24f1c51c7469303", + "reference": "d543de2019a0068e7b80da0ba24f1c51c7469303", + "shasum": "" + }, + "require": { + "php": "^8.0|^8.1" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "autoload": { + "psr-4": { + "Spatie\\Regex\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Sebastian De Deyne", + "email": "sebastian@spatie.be", + "homepage": "https://spatie.be", + "role": "Developer" + } + ], + "description": "A sane interface for php's built in preg_* functions", + "homepage": "https://github.com/spatie/regex", + "keywords": [ + "expression", + "expressions", + "regex", + "regular", + "spatie" + ], + "support": { + "issues": "https://github.com/spatie/regex/issues", + "source": "https://github.com/spatie/regex/tree/3.1.1" + }, + "funding": [ + { + "url": "https://spatie.be/open-source/support-us", + "type": "custom" + }, + { + "url": "https://github.com/spatie", + "type": "github" + } + ], + "time": "2021-11-30T21:13:59+00:00" + }, + { + "name": "spatie/security-advisories-health-check", + "version": "1.3.1", + "source": { + "type": "git", + "url": "https://github.com/spatie/security-advisories-health-check.git", + "reference": "150a9ef1f90cedc7289bc34e6f2fa181d0d74765" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/spatie/security-advisories-health-check/zipball/150a9ef1f90cedc7289bc34e6f2fa181d0d74765", + "reference": "150a9ef1f90cedc7289bc34e6f2fa181d0d74765", + "shasum": "" + }, + "require": { + "php": "^8.3", + "spatie/packagist-api": "^2.1" + }, + "require-dev": { + "nunomaduro/collision": "^8.0", + "pestphp/pest": "^4.0", + "phpstan/extension-installer": "^1.1", + "phpstan/phpstan-deprecation-rules": "^1.0", + "phpstan/phpstan-phpunit": "^1.0", + "spatie/laravel-health": "^1.22.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Spatie\\SecurityAdvisoriesHealthCheck\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Freek Van der Herten", + "email": "freek@spatie.be", + "role": "Developer" + } + ], + "description": "A Laravel Health check to security advisories for PHP packages", + "homepage": "https://github.com/spatie/security-advisories-health-check", + "keywords": [ + "laravel", + "security-advisories-health-check", + "spatie" + ], + "support": { + "source": "https://github.com/spatie/security-advisories-health-check/tree/1.3.1" + }, + "funding": [ + { + "url": "https://github.com/spatie", + "type": "github" + } + ], + "time": "2025-10-02T14:36:02+00:00" + }, { "name": "spatie/ssh", "version": "1.13.1", @@ -5953,6 +6398,67 @@ ], "time": "2025-11-23T11:35:56+00:00" }, + { + "name": "spatie/temporary-directory", + "version": "2.3.1", + "source": { + "type": "git", + "url": "https://github.com/spatie/temporary-directory.git", + "reference": "662e481d6ec07ef29fd05010433428851a42cd07" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/spatie/temporary-directory/zipball/662e481d6ec07ef29fd05010433428851a42cd07", + "reference": "662e481d6ec07ef29fd05010433428851a42cd07", + "shasum": "" + }, + "require": { + "php": "^8.0" + }, + "require-dev": { + "phpunit/phpunit": "^9.5" + }, + "type": "library", + "autoload": { + "psr-4": { + "Spatie\\TemporaryDirectory\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Alex Vanderbist", + "email": "alex@spatie.be", + "homepage": "https://spatie.be", + "role": "Developer" + } + ], + "description": "Easily create, use and destroy temporary directories", + "homepage": "https://github.com/spatie/temporary-directory", + "keywords": [ + "php", + "spatie", + "temporary-directory" + ], + "support": { + "issues": "https://github.com/spatie/temporary-directory/issues", + "source": "https://github.com/spatie/temporary-directory/tree/2.3.1" + }, + "funding": [ + { + "url": "https://spatie.be/open-source/support-us", + "type": "custom" + }, + { + "url": "https://github.com/spatie", + "type": "github" + } + ], + "time": "2026-01-12T07:42:22+00:00" + }, { "name": "symfony/clock", "version": "v7.4.0", diff --git a/routes/console.php b/routes/console.php index 6873c0d6..32d1541c 100644 --- a/routes/console.php +++ b/routes/console.php @@ -8,6 +8,9 @@ $this->comment(Inspiring::quote()); })->purpose('Display an inspiring quote'); +// Health check for Horizon +Schedule::command(\Spatie\Health\Commands\RunHealthChecksCommand::class)->everyFiveMinutes(); + // ///// Midtrial Emails /////// Schedule::command('polydock:dispatch-midtrial-emails') ->hourlyAt(5) @@ -48,3 +51,4 @@ // Schedule::command('polydock:remove-unclaimed-instances --force --limit=5') // ->hourly() // ->withoutOverlapping(); +