From 9798b19423fdf3e80b90add0511f6a5649328e0d Mon Sep 17 00:00:00 2001 From: coolsam726 Date: Sat, 20 Apr 2024 07:22:01 +0000 Subject: [PATCH] Fix styling --- src/Commands/ModuleMakeFilamentPageCommand.php | 2 +- src/Commands/ModuleMakeFilamentThemeCommand.php | 10 +++++----- src/Concerns/ModuleFilamentPlugin.php | 8 ++++---- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/Commands/ModuleMakeFilamentPageCommand.php b/src/Commands/ModuleMakeFilamentPageCommand.php index 9c3d5447..d4724e77 100644 --- a/src/Commands/ModuleMakeFilamentPageCommand.php +++ b/src/Commands/ModuleMakeFilamentPageCommand.php @@ -239,7 +239,7 @@ public function handle(): int (string) str($view) ->replace($module->getLowerName() . '::', '') ->replace('.', DIRECTORY_SEPARATOR) - ->prepend('views'.DIRECTORY_SEPARATOR) + ->prepend('views' . DIRECTORY_SEPARATOR) ->append('.blade.php'), ); diff --git a/src/Commands/ModuleMakeFilamentThemeCommand.php b/src/Commands/ModuleMakeFilamentThemeCommand.php index b47c908b..c7f03e6b 100644 --- a/src/Commands/ModuleMakeFilamentThemeCommand.php +++ b/src/Commands/ModuleMakeFilamentThemeCommand.php @@ -40,7 +40,7 @@ public function handle(): int 'yarn' => 'yarn add', default => "{$pm} install", }; - $cdCommand = 'cd '.$module->getPath(); + $cdCommand = 'cd ' . $module->getPath(); exec("$cdCommand && {$installCommand} tailwindcss @tailwindcss/forms @tailwindcss/typography postcss postcss-nesting autoprefixer --save-dev"); @@ -66,9 +66,9 @@ public function handle(): int 'viewPathPrefix' => $viewPathPrefix, ]); - $this->components->info('Filament theme [resources/css/filament/theme.css] and [resources/css/filament/tailwind.config.js] created successfully in '.$module->getStudlyName().' module.'); + $this->components->info('Filament theme [resources/css/filament/theme.css] and [resources/css/filament/tailwind.config.js] created successfully in ' . $module->getStudlyName() . ' module.'); - $buildDirectory = 'build-'.$module->getLowerName(); + $buildDirectory = 'build-' . $module->getLowerName(); $moduleStudlyName = $module->getStudlyName(); if (empty(glob($module->getExtraPath('vite.config.*s')))) { @@ -76,7 +76,7 @@ public function handle(): int $this->components->bulletList([ "It looks like you don't have Vite installed in your module. Please use your asset bundling system of choice to compile `resources/css/filament/theme.css` into `public/$buildDirectory/css/filament/theme.css`.", "If you're not currently using a bundler, we recommend using Vite. Alternatively, you can use the Tailwind CLI with the following command inside the $moduleStudlyName module:", - 'npx tailwindcss --input ./resources/css/filament/theme.css --output ./public/'.$buildDirectory.'/css/filament/theme.css --config ./resources/css/filament/tailwind.config.js --minify', + 'npx tailwindcss --input ./resources/css/filament/theme.css --output ./public/' . $buildDirectory . '/css/filament/theme.css --config ./resources/css/filament/tailwind.config.js --minify', "Make sure to register the theme in the {$moduleStudlyName} module plugin under the afterRegister() function using `->theme(asset('css/filament/theme.css'))`", ]); @@ -103,7 +103,7 @@ public function handle(): int protected function getDefaultStubPath(): string { - return __DIR__.'/stubs'; + return __DIR__ . '/stubs'; } private function getModule(): Module diff --git a/src/Concerns/ModuleFilamentPlugin.php b/src/Concerns/ModuleFilamentPlugin.php index a18868fb..abb5214e 100644 --- a/src/Concerns/ModuleFilamentPlugin.php +++ b/src/Concerns/ModuleFilamentPlugin.php @@ -19,15 +19,15 @@ public function register(Panel $panel): void $module = $this->getModule(); $useClusters = config('filament-modules.clusters.enabled', false); $panel->discoverPages( - in: $module->appPath('Filament'.DIRECTORY_SEPARATOR.'Pages'), + in: $module->appPath('Filament' . DIRECTORY_SEPARATOR . 'Pages'), for: $module->appNamespace('\\Filament\\Pages') ); $panel->discoverResources( - in: $module->appPath('Filament'.DIRECTORY_SEPARATOR.'Resources'), + in: $module->appPath('Filament' . DIRECTORY_SEPARATOR . 'Resources'), for: $module->appNamespace('\\Filament\\Resources') ); $panel->discoverWidgets( - in: $module->appPath('Filament'.DIRECTORY_SEPARATOR.'Widgets'), + in: $module->appPath('Filament' . DIRECTORY_SEPARATOR . 'Widgets'), for: $module->appNamespace('\\Filament\\Widgets') ); @@ -37,7 +37,7 @@ public function register(Panel $panel): void ); if ($useClusters) { - $path = $module->appPath('Filament'.DIRECTORY_SEPARATOR.'Clusters'); + $path = $module->appPath('Filament' . DIRECTORY_SEPARATOR . 'Clusters'); $namespace = $module->appNamespace('\\Filament\\Clusters'); $panel->discoverClusters( in: $path,