$paths */ public function __construct(private readonly array $paths) {} public static function fromConfig(): self { return new self(config('updater.protected_paths', [])); } public function isProtected(string $relativePath): bool { $path = ltrim(str_replace('\\', '/', $relativePath), '/'); foreach ($this->paths as $protected) { if (str_ends_with($protected, '/')) { if (str_starts_with($path.'/', $protected)) { return true; } } elseif ($path === $protected) { return true; } } return false; } }