From d13aad930e7b8c20eb8e0c9c3e4bb72d825cc8dd Mon Sep 17 00:00:00 2001 From: my4fdal Date: Fri, 2 Jul 2021 11:10:23 +0700 Subject: [PATCH 1/2] [badaso v2] add permission generate file docs and api-docs.json 0775 --- src/Helpers/ApiDocs.php | 3 +++ src/Middleware/GenerateForSwagger.php | 1 + 2 files changed, 4 insertions(+) diff --git a/src/Helpers/ApiDocs.php b/src/Helpers/ApiDocs.php index b5c146aa6..0d76eeb9e 100644 --- a/src/Helpers/ApiDocs.php +++ b/src/Helpers/ApiDocs.php @@ -504,6 +504,9 @@ public static function generateAPIDocs($table_name, $data_rows, $data_type) $stub = self::getStub($table_name, $data_rows, $data_type); $status_put_file = $filesystem->put($file_path, $stub); + if ($status_put_file) { + chmod($file_path, 0775); + } return $status_put_file; } diff --git a/src/Middleware/GenerateForSwagger.php b/src/Middleware/GenerateForSwagger.php index e6158688e..5c0ef2596 100644 --- a/src/Middleware/GenerateForSwagger.php +++ b/src/Middleware/GenerateForSwagger.php @@ -22,6 +22,7 @@ public function handle($request, Closure $next) } Artisan::call('l5-swagger:generate'); + chmod(storage_path('api-docs/api-docs.json'), 0775); break; } From f489f4943952a6e619de86e407f01872fd13b1b2 Mon Sep 17 00:00:00 2001 From: my4fdal Date: Fri, 2 Jul 2021 14:01:46 +0700 Subject: [PATCH 2/2] api docs --- src/Helpers/ApiDocs.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Helpers/ApiDocs.php b/src/Helpers/ApiDocs.php index 0d76eeb9e..6683fb2e5 100644 --- a/src/Helpers/ApiDocs.php +++ b/src/Helpers/ApiDocs.php @@ -294,7 +294,7 @@ class ApiDocs public static function getFilePath($table_name) { - $api_docs_path = app_path('Http\\Swagger\\swagger_models\\'); + $api_docs_path = app_path('Http/Swagger/swagger_models/'); return $api_docs_file = $api_docs_path.$table_name.'.php'; }