Revert "fix: handle panel ID correctly in make:filament-resource command"

This reverts commit ed5277f5f2.
This commit is contained in:
Marcelo Guerra
2024-06-04 21:00:45 -03:00
parent ed5277f5f2
commit 47c6baa412
@@ -12,7 +12,6 @@ use Filament\Support\Commands\Concerns\CanReadModelSchemas;
use Filament\Tables\Commands\Concerns\CanGenerateTables;
use Illuminate\Console\Command;
use Illuminate\Support\Arr;
use Illuminate\Support\Str;
use Symfony\Component\Console\Attribute\AsCommand;
use function Laravel\Prompts\select;
@@ -83,18 +82,13 @@ class MakeResourceCommand extends Command
$pluralModelClass = (string) str($modelClass)->pluralStudly();
$needsAlias = $modelClass === 'Record';
$panelOption = Str::lcfirst($this->option('panel'));
$panel = $this->option('panel');
if ($panelOption) {
$panel = Filament::getPanel($panelOption);
if ($panel->getId() !== $panelOption) {
$this->components->error("Panel [{$panelOption}] not found.");
return static::INVALID;
}
if ($panel) {
$panel = Filament::getPanel($panel);
}
if (! $panelOption) {
if (! $panel) {
$panels = Filament::getPanels();
/** @var Panel $panel */