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;'); +});