Skip to content

Commit f25180f

Browse files
author
Admin
committed
Fix info messages
1 parent c03fd90 commit f25180f

File tree

4 files changed

+27
-14
lines changed

4 files changed

+27
-14
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ This will create a template for **controller**, **service** and **model (with pr
2626

2727
If connection is not the default one, it can be specified in the command option.
2828

29-
If table is not the snake cased resourceName, then it can be specified in the table option.
29+
If table is not the snake cased resourceName, then it can be specified in the table option. It is advised to have the table migrated in DB already.
3030

3131
Run just **php artisan make:api-resource** or **php artisan make:api-resource --decorated** for interactive mode that will try to guess the tableName and use default connectionName.
3232

src/Console/MakeLaravelCrudWizard.php

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,12 +97,34 @@ public function handle(int $try = 0): void
9797
\array_diff($columns, ['created_at', 'updated_at', 'id'])
9898
);
9999

100-
if (!$this->option('decorated')) {
101-
return;
100+
$this->info('---------------------------------------------------------------------------------------------');
101+
$this->info('TODO:');
102+
103+
if ($this->ignoreError) {
104+
$this->info('- Create migration,');
105+
}
106+
107+
if ($composedPk) {
108+
$this->info('- Replace composed primary keys id_1, id_2, ... in model and service,');
109+
}
110+
111+
$this->info('- Fill the model\'s properties and relations,');
112+
$this->info('- Define validations in controller,');
113+
$this->info('- Expose resource in DbCrudMap::MODEL_FQN_TO_CONTROLLER_MAP.');
114+
115+
if ($this->option('decorated')) {
116+
$this->makeDecoratorService->makeCompleteDecoratorFile($this->resourceName, $ns, $columns);
117+
$this->makeMiddlewareService->makeCompleteMiddlewareFile($this->resourceName, $ns);
118+
119+
$this->info('- Fill the decorator,');
120+
$this->info('- Register middleware decorator as route middleware,');
121+
$this->info('- Use the middleware alias as middleware in your crud route definition for each method.');
102122
}
103123

104-
$this->makeDecoratorService->makeCompleteDecoratorFile($this->resourceName, $ns, $columns);
105-
$this->makeMiddlewareService->makeCompleteMiddlewareFile($this->resourceName, $ns);
124+
$this->info('---------------------------------------------------------------------------------------------');
125+
$this->info('Thank you for using laravel-crud-wizard-generator');
126+
$this->info('For more details see: https://github.com/macropay-solutions/laravel-crud-wizard-generator');
127+
$this->info('For full cruFd suite: https://laravel-crud-wizard.com');
106128
}
107129

108130
protected function interact(InputInterface $input, OutputInterface $output): void

src/Services/MakeControllerService.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,6 @@ protected function createControllerFile(string $controllerStub, string $resource
6363
if (!File::exists($path = $this->pathsAndNamespacesService->getRealpathBaseCustomController($resourceName))) {
6464
File::put($path, $controllerStub);
6565
$this->line('<info>Created Controller:</info> ' . $path);
66-
$this->info('TODO:');
67-
$this->info('- Create migration if needed,');
68-
$this->info('- Fill the model\'s properties and relations,');
69-
$this->info('- Define validations in controller,');
70-
$this->info('- Expose resource in DbCrudMap::MODEL_FQN_TO_CONTROLLER_MAP.');
7166

7267
return;
7368
}

src/Services/MakeMiddlewareService.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,6 @@ protected function createMiddlewareFile(string $middlewareStub, string $resource
4949
if (!File::exists($path = $this->pathsAndNamespacesService->getRealpathBaseCustomMiddleware($resourceName))) {
5050
File::put($path, $middlewareStub);
5151
$this->line('<info>Created Middleware:</info> ' . $path);
52-
$this->info('TODO:');
53-
$this->info('- Fill the decorator,');
54-
$this->info('- Register middleware decorator as route middleware,');
55-
$this->info('- Use the middleware alias as middleware in your crud route definition for each method.');
5652

5753
return;
5854
}

0 commit comments

Comments
 (0)