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.

feat(application): enhance watch path parsing to support negation syntax

Andras Bacsai54f6813f2956
diff --git a/app/Models/Application.php b/app/Models/Application.php
index 6541d73368..51abd60d60 100644
--- a/app/Models/Application.php
+++ b/app/Models/Application.php
@@ -1560,9 +1560,17 @@ class Application extends BaseModel
if ($value) {
$watch_paths = collect(explode("\n", $value))
->map(function (string $path): string {
- // Trim whitespace and remove leading slashes to normalize paths
+ // Trim whitespace
$path = trim($path);
+ if (str_starts_with($path, '!')) {
+ $negation = '!';
+ $pathWithoutNegation = substr($path, 1);
+ $pathWithoutNegation = ltrim(trim($pathWithoutNegation), '/');
+
+ return $negation.$pathWithoutNegation;
+ }
+
return ltrim($path, '/');
})
->filter(function (string $path): bool {