From 8ecf77eadbbd1667c9565fac223cfdbffd0a9e17 Mon Sep 17 00:00:00 2001 From: Andras Bacsai <5845193+andrasbacsai@users.noreply.github.com> Date: Tue, 18 Aug 2026 09:42:22 +0200 Subject: [PATCH] fix(postgresql): persist selected public access state --- .../Project/Database/Postgresql/General.php | 6 +++++- .../project/database/postgresql/general.blade.php | 2 +- tests/Feature/DatabasePublicAccessLoadingTest.php | 13 +++++++++++++ 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/app/Livewire/Project/Database/Postgresql/General.php b/app/Livewire/Project/Database/Postgresql/General.php index 8993cc251..051fb515d 100644 --- a/app/Livewire/Project/Database/Postgresql/General.php +++ b/app/Livewire/Project/Database/Postgresql/General.php @@ -209,11 +209,15 @@ public function instantSaveAdvanced() } } - public function instantSave() + public function instantSave(?bool $isPublic = null) { try { $this->authorize('update', $this->database); + if ($isPublic !== null) { + $this->isPublic = $isPublic; + } + if ($this->isPublic && ! $this->publicPort) { $this->dispatch('error', 'Public port is required.'); $this->isPublic = false; diff --git a/resources/views/livewire/project/database/postgresql/general.blade.php b/resources/views/livewire/project/database/postgresql/general.blade.php index 3288a0ac6..705cad441 100644 --- a/resources/views/livewire/project/database/postgresql/general.blade.php +++ b/resources/views/livewire/project/database/postgresql/general.blade.php @@ -89,7 +89,7 @@
- toContain('onChange="instantSave" :onChangeArgs="[]"'); + + $component = file_get_contents(app_path('Livewire/Project/Database/Postgresql/General.php')); + + expect($component) + ->toContain('public function instantSave(?bool $isPublic = null)') + ->toContain('$this->isPublic = $isPublic;'); +});