From 5d27831714c9465edf3e22271df9a36ceb3a3690 Mon Sep 17 00:00:00 2001 From: Roberto Butti Date: Fri, 12 Apr 2024 19:10:07 +0200 Subject: [PATCH] Restyling output for Sync Model command --- src/Console/Commands/SyncModel.php | 29 ++++++++++++++++++++++------- 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/src/Console/Commands/SyncModel.php b/src/Console/Commands/SyncModel.php index f4cc865..fe50e35 100644 --- a/src/Console/Commands/SyncModel.php +++ b/src/Console/Commands/SyncModel.php @@ -53,7 +53,7 @@ class SyncModel extends GeneratorCommand */ public function handle(): int { - + $this->output->title('Sync Model'); $markdownPath = $this->option('path'); $createModel = $this->option('create-model'); @@ -61,9 +61,15 @@ public function handle(): int $markdownPath = resource_path('content/article'); } - $this->info('Parsing the Markdown Directory: '.$markdownPath); + $this->components->twoColumnDetail( + 'Parsing the Markdown Directory', + sprintf('%s', $markdownPath)); + $modelName = basename($markdownPath); - $this->info('Folder Markdown Name: '.$modelName); + + $this->components->twoColumnDetail( + 'Folder Markdown Name', + sprintf('%s', $modelName)); if (! is_dir($markdownPath)) { $this->error(sprintf('The Folder %s does not exist!', $markdownPath)); @@ -92,11 +98,20 @@ public function handle(): int } $this->modelName = Str::studly($modelName); - $this->info('Model Name : '.$this->modelName.''); + $this->components->twoColumnDetail( + 'Model Name', + sprintf('%s', $this->modelName)); + + $this->output->newLine(); $this->frontmatterFields = '"'.implode('","', $collectedFields).'"'; - $this->info('In the frontmatterFields method you have to return: '. - $this->frontmatterFields. - ''); + $this->components->twoColumnDetail( + 'In the frontmatterFields() method you have to return:', + '' + ); + $this->components->twoColumnDetail( + '', + $this->frontmatterFields + ); if ($createModel) { parent::handle();