environment('local'); } public static function shouldRegisterNavigation(): bool { return app()->environment('local'); } public function mount(): void { $this->form->fill([ 'create_git_branch' => true, 'include_api' => false, ]); $this->loadModules(); } public function loadModules(): void { $discovery = new ModuleDiscoveryService(); $this->modules = $discovery->discoverModules(); $this->summary = $discovery->getModuleSummary(); } public function toggleModule(string $moduleName): void { $this->expandedModule = $this->expandedModule === $moduleName ? null : $moduleName; } public function form(Form $form): Form { return $form ->schema([ Section::make('Module Details') ->description('Create a new module skeleton with all the necessary folders and files.') ->schema([ TextInput::make('name') ->label('Module Name') ->placeholder('e.g., Accounting, Inventory, HumanResources') ->helperText('Use PascalCase. This will create app/Modules/YourModuleName/') ->required() ->maxLength(50) ->rules(['regex:/^[A-Z][a-zA-Z0-9]*$/']) ->validationMessages([ 'regex' => 'Module name must be PascalCase (start with uppercase, letters and numbers only).', ]) ->live(onBlur: true) ->afterStateUpdated(fn ($state, callable $set) => $set('name', Str::studly($state)) ), Textarea::make('description') ->label('Description') ->placeholder('Brief description of what this module does...') ->rows(2) ->maxLength(255), ]), Section::make('Options') ->schema([ Toggle::make('create_git_branch') ->label('Create Git Branch') ->helperText('Automatically create and checkout a new branch: module/{module-name}') ->default(true), Toggle::make('include_api') ->label('Include API Routes') ->helperText('Add Routes/api.php with Sanctum authentication') ->default(false), ]) ->columns(2), Section::make('What Will Be Created') ->schema([ \Filament\Forms\Components\Placeholder::make('structure') ->label('') ->content(fn () => new \Illuminate\Support\HtmlString('