name(static::$name) ->hasCommands($this->getCommands()) ->hasInstallCommand(function (InstallCommand $command) { $command ->publishConfigFile() ->publishMigrations() ->askToRunMigrations() ->askToStarRepoOnGitHub(':vendor_slug/:package_slug'); }); $configFileName = $package->shortName(); if (file_exists($package->basePath("/../config/{$configFileName}.php"))) { $package->hasConfigFile(); } if (file_exists($package->basePath('/../database/migrations'))) { $package->hasMigrations($this->getMigrations()); } if (file_exists($package->basePath('/../resources/lang'))) { $package->hasTranslations(); } if (file_exists($package->basePath('/../resources/views'))) { $package->hasViews(static::$viewNamespace); } } public function packageRegistered(): void { } public function packageBooted(): void { // Asset Registration FilamentAsset::register( $this->getAssets(), $this->getAssetPackageName() ); FilamentAsset::registerScriptData( $this->getScriptData(), $this->getAssetPackageName() ); // Icon Registration FilamentIcon::register($this->getIcons()); // Handle Stubs if (app()->runningInConsole()) { foreach (app(Filesystem::class)->files(__DIR__ . '/../stubs/') as $file) { $this->publishes([ $file->getRealPath() => base_path("stubs/skeleton/{$file->getFilename()}"), ], 'skeleton-stubs'); } } // Testing Testable::mixin(new TestsSkeleton()); } protected function getAssetPackageName(): ?string { return ':vendor_slug/:package_slug'; } /** * @return array */ protected function getAssets(): array { return [ // AlpineComponent::make('skeleton', __DIR__ . '/../resources/dist/components/skeleton.js'), Css::make('skeleton-styles', __DIR__ . '/../resources/dist/skeleton.css'), Js::make('skeleton-scripts', __DIR__ . '/../resources/dist/skeleton.js'), ]; } /** * @return array */ protected function getCommands(): array { return [ SkeletonCommand::class, ]; } /** * @return array */ protected function getIcons(): array { return []; } /** * @return array */ protected function getRoutes(): array { return []; } /** * @return array */ protected function getScriptData(): array { return []; } /** * @return array */ protected function getMigrations(): array { return [ 'create_skeleton_table', ]; } }