From 856e708e466f55f02fb7df0dbe08ba4927a37d88 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Munsch?= Date: Wed, 4 Aug 2021 13:17:00 +0200 Subject: [PATCH] Client generate add api config json --- app/Console/Commands/GenerateCrmClient.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/app/Console/Commands/GenerateCrmClient.php b/app/Console/Commands/GenerateCrmClient.php index c22a060..9d72381 100644 --- a/app/Console/Commands/GenerateCrmClient.php +++ b/app/Console/Commands/GenerateCrmClient.php @@ -43,6 +43,20 @@ class GenerateCrmClient extends Command $this->copyExceptions(); $this->copyTranslations(); $this->copyRoutesList(); + $this->copyApiConfigInfo(); + } + + private function copyApiConfigInfo() + { + $this->info('Copy Api Config'); + $rootTarget = app_path('../' . self::TARGET); + if (File::exists("$rootTarget/../apiConfig.readonly.json")) { + File::delete("$rootTarget/../apiConfig.readonly.json"); + } + File::put( + "$rootTarget/../apiConfig.readonly.json", + \json_encode(config('api'), JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES) + ); } private function copyRoutesList()