Skip to content

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.

fix(sentinel): clarify restart after settings update

Andras Bacsai1073bbca83a6
diff --git a/app/Livewire/Server/Sentinel.php b/app/Livewire/Server/Sentinel.php
index cd05002aae..a69eb3f807 100644
--- a/app/Livewire/Server/Sentinel.php
+++ b/app/Livewire/Server/Sentinel.php
@@ -146,7 +146,7 @@ class Sentinel extends Component
{
try {
$this->syncData(true);
- $this->dispatch('success', 'Sentinel settings updated.');
+ $this->dispatch('success', 'Sentinel settings updated. Restarting Sentinel.');
} catch (\Throwable $e) {
return handleError($e, $this);
}
diff --git a/tests/Feature/Livewire/SentinelComponentTest.php b/tests/Feature/Livewire/SentinelComponentTest.php
index 41b3f2b497..01250910aa 100644
--- a/tests/Feature/Livewire/SentinelComponentTest.php
+++ b/tests/Feature/Livewire/SentinelComponentTest.php
@@ -36,3 +36,12 @@ it('does not repeat a disabled status badge in the sentinel empty state', functi
expect($view)->not->toContain("? 'Disabled'");
});
+
+it('tells the user that saving sentinel settings initiates a restart', function () {
+ $componentSource = file_get_contents(app_path('Livewire/Server/Sentinel.php'));
+
+ preg_match('/public function submit\([^)]*\).*?\{(?<body>.*?)\n \}/s', $componentSource, $matches);
+
+ expect($matches['body'] ?? '')
+ ->toContain("\$this->dispatch('success', 'Sentinel settings updated. Restarting Sentinel.');");
+});