From f49cce7671f5b8657c4c46f54756c8b6140b731f Mon Sep 17 00:00:00 2001 From: Mohammad Hafijul Islam Date: Wed, 5 Jun 2024 15:11:06 +0600 Subject: [PATCH] status code append on response disabled --- src/Commands/ModelMakeCommand.php | 33 ------------------------------- src/helpers.php | 16 +++++++-------- 2 files changed, 8 insertions(+), 41 deletions(-) diff --git a/src/Commands/ModelMakeCommand.php b/src/Commands/ModelMakeCommand.php index 026c669..266eca3 100644 --- a/src/Commands/ModelMakeCommand.php +++ b/src/Commands/ModelMakeCommand.php @@ -49,9 +49,7 @@ public function handle(): int } $this->handleOptionalMigrationOption(); - $this->handleOptionalControllerOption(); $this->handleOptionalSeedOption(); - $this->handleOptionalRequestOption(); return 0; } @@ -90,21 +88,6 @@ private function createMigrationName() return $string; } - /** - * Create the controller file for the given model if controller flag was used - */ - private function handleOptionalControllerOption() - { - if ($this->option('controller') === true) { - $controllerName = "{$this->getModelName()}Controller"; - - $this->call('laraflow:make-controller', array_filter([ - 'controller' => $controllerName, - 'module' => $this->argument('module'), - ])); - } - } - /** * @return mixed|string */ @@ -130,22 +113,6 @@ protected function handleOptionalSeedOption() } } - /** - * Create a request file for the model. - * - * @return void - */ - protected function handleOptionalRequestOption() - { - if ($this->option('request') === true) { - $requestName = "{$this->getModelName()}Request"; - - $this->call('laraflow:make-request', array_filter([ - 'name' => $requestName, - 'module' => $this->argument('module'), - ])); - } - } /** * Get the console command arguments. diff --git a/src/helpers.php b/src/helpers.php index f4b2dc2..9a00d3c 100644 --- a/src/helpers.php +++ b/src/helpers.php @@ -10,16 +10,16 @@ function response_format($data, $statusCode = null): mixed { if (is_string($data)) { $data = ['message' => $data]; - if ($statusCode != null && config('fintech.core.append_status_code')) { - $data['code'] = $statusCode; - } +// if ($statusCode != null && config('api-crud.append_status_code')) { +// $data['code'] = $statusCode; +// } } - if (is_array($data) && !isset($data['code'])) { - if ($statusCode != null && config('fintech.core.append_status_code')) { - $data['code'] = $statusCode; - } - } +// if (is_array($data) && !isset($data['code'])) { +// if ($statusCode != null && config('api-crud.append_status_code')) { +// $data['code'] = $statusCode; +// } +// } return $data; }