diff --git a/src/Commands/FilamentJetstreamCommand.php b/src/Commands/FilamentJetstreamCommand.php index 89a0d61..39dce27 100644 --- a/src/Commands/FilamentJetstreamCommand.php +++ b/src/Commands/FilamentJetstreamCommand.php @@ -20,7 +20,7 @@ public function handle(): int { $this->info('Filament Jetstream scaffolding...'); - if (!$this->installFilamentPackage() || !$this->installJetstreamPackage()) { + if (! $this->installFilamentPackage() || ! $this->installJetstreamPackage()) { return self::FAILURE; } @@ -58,7 +58,7 @@ public function handle(): int */ protected function installFilamentPackage(): bool { - if (!$this->hasComposerPackage('filament/filament')) { + if (! $this->hasComposerPackage('filament/filament')) { return $this->requireComposerPackages('filament/filament:^3.2'); } @@ -70,7 +70,7 @@ protected function installFilamentPackage(): bool */ protected function installJetstreamPackage(): bool { - if (!$this->hasComposerPackage('laravel/jetstream')) { + if (! $this->hasComposerPackage('laravel/jetstream')) { return $this->requireComposerPackages('laravel/jetstream:^4.2'); } @@ -207,18 +207,17 @@ protected function configurePanel() $filesystem->ensureDirectoryExists(app_path('Providers/Filament')); collect($filesystem->files(app_path('Providers/Filament'))) - ->map(fn(\SplFileInfo $fileInfo) => str($fileInfo->getFilename()) + ->map(fn (\SplFileInfo $fileInfo) => str($fileInfo->getFilename()) ->before('.php') ->prepend("App\Providers\Filament") ->append('::class,') ->toString()) ->each( - fn($value) => $this->replaceInFile(search: $value, replace: '', path: config_path('app.php')) + fn ($value) => $this->replaceInFile(search: $value, replace: '', path: config_path('app.php')) ); $filesystem->deleteDirectory(app_path('Providers/Filament')); - $this->callSilently('make:filament-panel', ['id' => 'app', '--force' => true]); $this->replaceInFile( @@ -314,12 +313,12 @@ protected function runCommands(array $commands): void try { $process->setTty(true); } catch (\RuntimeException $e) { - $this->output->writeln(' WARN '.$e->getMessage().PHP_EOL); + $this->output->writeln(' WARN ' . $e->getMessage() . PHP_EOL); } } $process->run(function ($type, $line) { - $this->output->write(' '.$line); + $this->output->write(' ' . $line); }); } @@ -337,14 +336,14 @@ protected function hasComposerPackage(string $package): bool /** * Installs the given Composer Packages into the application. */ - protected function requireComposerPackages(array|string $packages): bool + protected function requireComposerPackages(array | string $packages): bool { $command = array_merge( ['composer', 'require'], is_array($packages) ? $packages : func_get_args() ); - return !(new Process($command, base_path(), ['COMPOSER_MEMORY_LIMIT' => '-1'])) + return ! (new Process($command, base_path(), ['COMPOSER_MEMORY_LIMIT' => '-1'])) ->setTimeout(null) ->run(function ($type, $output) { $this->output->write($output);