name('filament-forms') ->hasCommands($this->getCommands()) ->hasTranslations() ->hasViews(); } public function packageBooted(): void { FilamentAsset::register([ AlpineComponent::make('color-picker', __DIR__ . '/../dist/components/color-picker.js'), AlpineComponent::make('date-time-picker', __DIR__ . '/../dist/components/date-time-picker.js'), AlpineComponent::make('file-upload', __DIR__ . '/../dist/components/file-upload.js'), AlpineComponent::make('key-value', __DIR__ . '/../dist/components/key-value.js'), AlpineComponent::make('markdown-editor', __DIR__ . '/../dist/components/markdown-editor.js'), AlpineComponent::make('rich-editor', __DIR__ . '/../dist/components/rich-editor.js'), AlpineComponent::make('select', __DIR__ . '/../dist/components/select.js'), AlpineComponent::make('tags-input', __DIR__ . '/../dist/components/tags-input.js'), AlpineComponent::make('textarea', __DIR__ . '/../dist/components/textarea.js'), Css::make('forms', __DIR__ . '/../dist/index.css'), ], 'filament/forms'); if ($this->app->runningInConsole()) { foreach (app(Filesystem::class)->files(__DIR__ . '/../stubs/') as $file) { $this->publishes([ $file->getRealPath() => base_path("stubs/filament/{$file->getFilename()}"), ], 'filament-stubs'); } } Testable::mixin(new TestsForms); Testable::mixin(new TestsComponentActions); } /** * @return array */ protected function getCommands(): array { $commands = [ Commands\MakeFieldCommand::class, Commands\MakeFormCommand::class, Commands\MakeLayoutComponentCommand::class, ]; $aliases = []; foreach ($commands as $command) { $class = 'Filament\\Forms\\Commands\\Aliases\\' . class_basename($command); if (! class_exists($class)) { continue; } $aliases[] = $class; } return [ ...$commands, ...$aliases, ]; } }