mirror of
https://github.com/filamentphp/filament.git
synced 2026-09-24 15:42:09 +08:00
Remove ::setRootNamespace and ::getRootNamespace to avoid adding additional config to filament
This commit is contained in:
@@ -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('/')
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user