An open-source, self-hostable PaaS alternative to Vercel, Heroku & Netlify that lets you easily deploy static sites, databases, full-stack applications and 360+ one-click services on your own servers.
PHP coolifydatabasesdeploymentdockerdocker-composeinertiajslaravelmariadbmysqlnextjsnodejsphppostgresredisself-hostedself-hostingserverstatic-sitesveltesvelte5
feat(monitoring): add Laravel Nightwatch monitoring support
Andras Bacsaic09d7e412e62
diff --git a/.env.development.example b/.env.development.exampleindex b0b15f3242..594b89201e 100644--- a/.env.development.example+++ b/.env.development.example@@ -24,6 +24,10 @@ RAY_ENABLED=false# Enable Laravel Telescope for debuggingTELESCOPE_ENABLED=false+# Enable Laravel Nightwatch monitoring+NIGHTWATCH_ENABLED=false+NIGHTWATCH_TOKEN=+# Selenium Driver URL for DuskDUSK_DRIVER_URL=http://selenium:4444diff --git a/app/Console/Commands/Nightwatch.php b/app/Console/Commands/Nightwatch.phpnew file mode 100644index 0000000000..40fd86a81e--- /dev/null+++ b/app/Console/Commands/Nightwatch.php@@ -0,0 +1,22 @@+<?php++namespace App\Console\Commands;++use Illuminate\Console\Command;++class Nightwatch extends Command+{+ protected $signature = 'start:nightwatch';++ protected $description = 'Start Nightwatch';++ public function handle(): void+ {+ if (config('constants.nightwatch.is_nightwatch_enabled')) {+ $this->info('Nightwatch is enabled on this server.');+ $this->call('nightwatch:agent');+ }++ exit(0);+ }+}diff --git a/composer.json b/composer.jsonindex d4fb1eb8e5..e2b16b31b8 100644--- a/composer.json+++ b/composer.json@@ -18,6 +18,7 @@"laravel/fortify": "^1.34.0","laravel/framework": "^12.49.0","laravel/horizon": "^5.43.0",+ "laravel/nightwatch": "^1.24","laravel/pail": "^1.2.4","laravel/prompts": "^0.3.11|^0.3.11|^0.3.11","laravel/sanctum": "^4.3.0",diff --git a/composer.lock b/composer.lockindex 993835a423..3a66fdd5a1 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": "19bb661d294e5cf623e68830604e4f60",+ "content-hash": "40bddea995c1744e4aec517263109a2f","packages": [{"name": "aws/aws-crt-php",@@ -2065,6 +2065,100 @@},"time": "2026-02-21T14:20:09+00:00"},+ {+ "name": "laravel/nightwatch",+ "version": "v1.24.4",+ "source": {+ "type": "git",+ "url": "https://github.com/laravel/nightwatch.git",+ "reference": "127e9bb9928f0fcf69b52b244053b393c90347c8"+ },+ "dist": {+ "type": "zip",+ "url": "https://api.github.com/repos/laravel/nightwatch/zipball/127e9bb9928f0fcf69b52b244053b393c90347c8",+ "reference": "127e9bb9928f0fcf69b52b244053b393c90347c8",+ "shasum": ""+ },+ "require": {+ "ext-zlib": "*",+ "guzzlehttp/promises": "^2.0",+ "laravel/framework": "^10.0|^11.0|^12.0|^13.0",+ "monolog/monolog": "^3.6",+ "nesbot/carbon": "^2.0|^3.0",+ "php": "^8.2",+ "psr/http-message": "^1.0|^2.0",+ "psr/log": "^1.0|^2.0|^3.0",+ "ramsey/uuid": "^4.0",+ "symfony/console": "^6.0|^7.0|^8.0",+ "symfony/http-foundation": "^6.0|^7.0|^8.0",+ "symfony/polyfill-php84": "^1.29"+ },+ "require-dev": {+ "aws/aws-sdk-php": "^3.349",+ "ext-pcntl": "*",+ "ext-pdo": "*",+ "guzzlehttp/guzzle": "^7.0",+ "guzzlehttp/psr7": "^2.0",+ "laravel/horizon": "^5.4",+ "laravel/pint": "1.21.0",+ "laravel/vapor-core": "^2.38.2",+ "livewire/livewire": "^2.0|^3.0",+ "mockery/mockery": "^1.0",+ "mongodb/laravel-mongodb": "^4.0|^5.0",+ "orchestra/testbench": "^8.0|^9.0|^10.0",+ "orchestra/testbench-core": "^8.0|^9.0|^10.0",+ "orchestra/workbench": "^8.0|^9.0|^10.0",+ "phpstan/phpstan": "^1.0",+ "phpunit/phpunit": "^10.0|^11.0|^12.0",+ "singlestoredb/singlestoredb-laravel": "^1.0|^2.0",+ "spatie/laravel-ignition": "^2.0",+ "symfony/mailer": "^6.0|^7.0|^8.0",+ "symfony/mime": "^6.0|^7.0|^8.0",+ "symfony/var-dumper": "^6.0|^7.0|^8.0"+ },+ "type": "library",+ "extra": {+ "laravel": {+ "aliases": {+ "Nightwatch": "Laravel\\Nightwatch\\Facades\\Nightwatch"+ },+ "providers": [+ "Laravel\\Nightwatch\\NightwatchServiceProvider"+ ]+ }+ },+ "autoload": {+ "files": [+ "agent/helpers.php"+ ],+ "psr-4": {+ "Laravel\\Nightwatch\\": "src/"+ }+ },+ "notification-url": "https://packagist.org/downloads/",+ "license": [+ "MIT"+ ],+ "authors": [+ {+ "name": "Taylor Otwell",+ "email": "[email protected]"+ }+ ],+ "description": "The official Laravel Nightwatch package.",+ "homepage": "https://nightwatch.laravel.com",+ "keywords": [+ "Insights",+ "laravel",+ "monitoring"+ ],+ "support": {+ "docs": "https://nightwatch.laravel.com/docs",+ "issues": "https://github.com/laravel/nightwatch/issues",+ "source": "https://github.com/laravel/nightwatch"+ },+ "time": "2026-03-18T23:25:05+00:00"+ },{"name": "laravel/pail","version": "v1.2.6",@@ -17209,5 +17303,5 @@"php": "^8.4"},"platform-dev": {},- "plugin-api-version": "2.9.0"+ "plugin-api-version": "2.6.0"}diff --git a/config/constants.php b/config/constants.phpindex 9c6454cae5..803a0a0bd5 100644--- a/config/constants.php+++ b/config/constants.php@@ -55,6 +55,10 @@ return ['is_scheduler_enabled' => env('SCHEDULER_ENABLED', true),],+ 'nightwatch' => [+ 'is_nightwatch_enabled' => env('NIGHTWATCH_ENABLED', false),+ ],+'docker' => ['minimum_required_version' => '24.0',],diff --git a/docker/development/etc/s6-overlay/s6-rc.d/nightwatch-agent/dependencies.d/init-setup b/docker/development/etc/s6-overlay/s6-rc.d/nightwatch-agent/dependencies.d/init-setupnew file mode 100644index 0000000000..8b13789179--- /dev/null+++ b/docker/development/etc/s6-overlay/s6-rc.d/nightwatch-agent/dependencies.d/init-setup@@ -0,0 +1 @@+diff --git a/docker/development/etc/s6-overlay/s6-rc.d/nightwatch-agent/run b/docker/development/etc/s6-overlay/s6-rc.d/nightwatch-agent/runnew file mode 100644index 0000000000..1166ccd089--- /dev/null+++ b/docker/development/etc/s6-overlay/s6-rc.d/nightwatch-agent/run@@ -0,0 +1,12 @@+#!/command/execlineb -P++# Use with-contenv to ensure environment variables are available+with-contenv+cd /var/www/html++foreground {+ php+ artisan+ start:nightwatch+}+diff --git a/docker/development/etc/s6-overlay/s6-rc.d/nightwatch-agent/type b/docker/development/etc/s6-overlay/s6-rc.d/nightwatch-agent/typenew file mode 100644index 0000000000..5883cff0cd--- /dev/null+++ b/docker/development/etc/s6-overlay/s6-rc.d/nightwatch-agent/type@@ -0,0 +1 @@+longrundiff --git a/docker/development/etc/s6-overlay/s6-rc.d/user/contents.d/nightwatch-agent b/docker/development/etc/s6-overlay/s6-rc.d/user/contents.d/nightwatch-agentnew file mode 100644index 0000000000..8b13789179--- /dev/null+++ b/docker/development/etc/s6-overlay/s6-rc.d/user/contents.d/nightwatch-agent@@ -0,0 +1 @@+diff --git a/docker/production/etc/s6-overlay/s6-rc.d/nightwatch-agent/dependencies.d/init-script b/docker/production/etc/s6-overlay/s6-rc.d/nightwatch-agent/dependencies.d/init-scriptnew file mode 100644index 0000000000..8b13789179--- /dev/null+++ b/docker/production/etc/s6-overlay/s6-rc.d/nightwatch-agent/dependencies.d/init-script@@ -0,0 +1 @@+diff --git a/docker/production/etc/s6-overlay/s6-rc.d/nightwatch-agent/run b/docker/production/etc/s6-overlay/s6-rc.d/nightwatch-agent/runnew file mode 100644index 0000000000..80d73eadb8--- /dev/null+++ b/docker/production/etc/s6-overlay/s6-rc.d/nightwatch-agent/run@@ -0,0 +1,11 @@+#!/command/execlineb -P++# Use with-contenv to ensure environment variables are available+with-contenv+cd /var/www/html+foreground {+ php+ artisan+ start:nightwatch+}+diff --git a/docker/production/etc/s6-overlay/s6-rc.d/nightwatch-agent/type b/docker/production/etc/s6-overlay/s6-rc.d/nightwatch-agent/typenew file mode 100644index 0000000000..5883cff0cd--- /dev/null+++ b/docker/production/etc/s6-overlay/s6-rc.d/nightwatch-agent/type@@ -0,0 +1 @@+longrundiff --git a/docker/production/etc/s6-overlay/s6-rc.d/user/contents.d/nightwatch-agent b/docker/production/etc/s6-overlay/s6-rc.d/user/contents.d/nightwatch-agentnew file mode 100644index 0000000000..8b13789179--- /dev/null+++ b/docker/production/etc/s6-overlay/s6-rc.d/user/contents.d/nightwatch-agent@@ -0,0 +1 @@+diff --git a/phpunit.xml b/phpunit.xmlindex 6716b6b84c..5d55acf750 100644--- a/phpunit.xml+++ b/phpunit.xml@@ -22,6 +22,7 @@<env name="QUEUE_CONNECTION" value="sync" force="true"/><env name="SESSION_DRIVER" value="array" force="true"/><env name="TELESCOPE_ENABLED" value="false"/>+ <env name="NIGHTWATCH_ENABLED" value="false"/></php><source><include>