Use getModuleFilamentPageComponentLocation(string $moduleName, ?string $panelId = null, bool $forCluster = false) to determine where a module's Filament pages should be stored and namespaced. This is useful for scaffolding or locating custom components.
It returns an array containing:
namespace: The PHP namespace for the component class.path: The filesystem path to the Blade view.viewNamespace: The Blade view namespace (the module's lower-case name).
Behavior based on arguments:
- No
$panelId and $forCluster is false: Targets resources/views/filament/pages and Filament\Pages namespace. - With
$panelId: Targets resources/views/filament/{panel-kebab-name} and Filament\{PanelStudlyName} namespace. - With
$forCluster as true: Targets resources/views/filament/clusters and Filament\Clusters namespace.
$location = $modules->getModuleFilamentPageComponentLocation('blog', 'admin');
// Returns:
// [
// 'namespace' => 'Modules\\Blog\\Filament\\Admin',
// 'path' => '/path/to/Modules/Blog/resources/views/filament/admin',
// 'viewNamespace' => 'blog'
// ]