From fc1afeb36bb32cc1344cbe8f8841daaf47ebb818 Mon Sep 17 00:00:00 2001 From: Luke Towers Date: Tue, 7 Oct 2025 23:35:11 -0600 Subject: [PATCH 1/2] Use ConfigRepository methods Uses the methods provided by the Config Repository to interact with the config data instead of directly accessing the raw internal array of data. This fixes support for applications that might not store the config values in the exact internal array structure that we are expecting (i.e. Winter CMS, which stores everything under namespaced keys, where top level keys end up having "*::" prefixed to their key in the internal array. The switch to accessing the raw array internals of the Config Repository occurred in https://github.com/laravel/nightwatch/commit/cd09cd021b29ab9d441521625b20a5cc933791ac#diff-f418488ec2f97353bcc9eaf797747e525178b3746278ca795966c7b0aea2c883L65-L302 and it appears to have unintentional side effects. --- src/NightwatchServiceProvider.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/NightwatchServiceProvider.php b/src/NightwatchServiceProvider.php index c40c38ec..0d53fbd3 100644 --- a/src/NightwatchServiceProvider.php +++ b/src/NightwatchServiceProvider.php @@ -184,7 +184,7 @@ private function registerAndCaptureConfig(): void $this->config = $this->app->make(Repository::class); - $this->nightwatchConfig = $this->config->all()['nightwatch'] ?? []; + $this->nightwatchConfig = $this->config->get('nightwatch', []); } private function registerBindings(): void @@ -197,7 +197,7 @@ private function registerBindings(): void private function registerLogger(): void { - if (! isset($this->config->all()['logging']['channels']['nightwatch'])) { + if (! $this->config->has('logging.channels.nightwatch')) { $this->config->set('logging.channels.nightwatch', [ 'driver' => 'custom', 'via' => Logger::class, From 8e9796da1ff76f2c092c0a41d1b67096ce519f55 Mon Sep 17 00:00:00 2001 From: Luke Towers Date: Tue, 7 Oct 2025 23:41:39 -0600 Subject: [PATCH 2/2] Appease the almighty stan --- src/NightwatchServiceProvider.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/NightwatchServiceProvider.php b/src/NightwatchServiceProvider.php index 0d53fbd3..c6ad19d9 100644 --- a/src/NightwatchServiceProvider.php +++ b/src/NightwatchServiceProvider.php @@ -184,7 +184,7 @@ private function registerAndCaptureConfig(): void $this->config = $this->app->make(Repository::class); - $this->nightwatchConfig = $this->config->get('nightwatch', []); + $this->nightwatchConfig = (array) $this->config->get('nightwatch', []); } private function registerBindings(): void