mirror of
https://github.com/filamentphp/filament.git
synced 2026-09-24 15:42:09 +08:00
Fix select() issue in MakeWidgetCommand
This commit is contained in:
@@ -74,6 +74,7 @@ class MakeWidgetCommand extends Command
|
||||
|
||||
if (! $panel) {
|
||||
$panels = Filament::getPanels();
|
||||
$namespace = config('livewire.class_namespace');
|
||||
|
||||
/** @var ?Panel $panel */
|
||||
$panel = $panels[select(
|
||||
@@ -83,8 +84,8 @@ class MakeWidgetCommand extends Command
|
||||
fn (Panel $panel): string => "The [{$panel->getId()}] panel",
|
||||
$panels,
|
||||
),
|
||||
'' => '[App\\Livewire] alongside other Livewire components',
|
||||
]),
|
||||
$namespace => "[{$namespace}] alongside other Livewire components",
|
||||
])
|
||||
)] ?? null;
|
||||
}
|
||||
}
|
||||
@@ -95,8 +96,8 @@ class MakeWidgetCommand extends Command
|
||||
$resourceNamespace = null;
|
||||
|
||||
if (! $panel) {
|
||||
$path = app_path('Livewire/');
|
||||
$namespace = 'App\\Livewire';
|
||||
$namespace = config('livewire.class_namespace');
|
||||
$path = app_path(Str::of($namespace)->after('App\\')->replace('\\', '/')->toString());
|
||||
} elseif ($resource === null) {
|
||||
$widgetDirectories = $panel->getWidgetDirectories();
|
||||
$widgetNamespaces = $panel->getWidgetNamespaces();
|
||||
|
||||
Reference in New Issue
Block a user