Remove ::setRootNamespace and ::getRootNamespace to avoid adding additional config to filament

This commit is contained in:
steelvirus
2025-08-06 13:31:14 +02:00
parent ca8451f859
commit a1b6a3ffcb
2 changed files with 2 additions and 14 deletions
@@ -382,7 +382,7 @@ class MakePageCommand extends Command
->whenContains(
'Filament\\',
fn (Stringable $fqn) => $fqn->after('Filament\\')->prepend('Filament\\'),
fn (Stringable $fqn) => $fqn->replaceFirst(Filament::getRootNamespace(), ''),
fn (Stringable $fqn) => $fqn->replaceFirst(app()->getNamespace(), ''),
)
->replace('\\', '/')
->explode('/')
+1 -13
View File
@@ -48,8 +48,6 @@ class FilamentManager
protected ?Model $tenant = null;
protected ?string $rootNamespace = null;
public function auth(): Guard
{
return $this->getCurrentOrDefaultPanel()->auth();
@@ -1056,22 +1054,12 @@ class FilamentManager
return $this->getCurrentOrDefaultPanel()->getErrorNotifications();
}
public function setRootNamespace(string $namespace): void
{
$this->rootNamespace = $namespace;
}
public function getRootNamespace(): string
{
return $this->rootNamespace ?? app()->getNamespace();
}
/**
* @param class-string|non-empty-string $namespace
* @return class-string
*/
public function namespaceFor(string $namespace): string
{
return $this->getRootNamespace() . $namespace;
return app()->getNamespace() . $namespace;
}
}