diff --git a/config/auto-doc.php b/config/auto-doc.php index 0d33f099..3b71f8ab 100644 --- a/config/auto-doc.php +++ b/config/auto-doc.php @@ -92,7 +92,7 @@ | `RonasIT\Support\AutoDoc\Interfaces\SwaggerDriverInterface` interface, | or one of our drivers from the `drivers` config: */ - 'driver' => 'local', + 'driver' => env('SWAGGER_DRIVER', 'local'), 'drivers' => [ 'local' => [ @@ -101,8 +101,8 @@ ], 'remote' => [ 'class' => RemoteDriver::class, - 'key' => 'project_name', - 'url' => 'https://example.com' + 'key' => env('SWAGGER_REMOTE_DRIVER_KEY', 'project_name'), + 'url' => env('SWAGGER_REMOTE_DRIVER_URL', 'https://example.com') ], 'storage' => [ 'class' => StorageDriver::class, @@ -114,7 +114,7 @@ | | One of the filesystems.disks config value */ - 'disk' => 'public', + 'disk' => env('SWAGGER_STORAGE_DRIVER_DISK', 'public'), 'production_path' => 'documentation.json' ] ], @@ -131,5 +131,5 @@ 'development' ], - 'config_version' => '2.0' + 'config_version' => '2.1' ]; diff --git a/src/Drivers/RemoteDriver.php b/src/Drivers/RemoteDriver.php index 5ad91bb3..418d1693 100755 --- a/src/Drivers/RemoteDriver.php +++ b/src/Drivers/RemoteDriver.php @@ -40,8 +40,9 @@ public function saveData() curl_setopt($curl, CURLOPT_URL, $this->getUrl()); curl_setopt($curl, CURLOPT_POST, true); - curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($this->getTmpData())); + curl_setopt($curl, CURLOPT_POSTFIELDS, json_encode($this->getTmpData())); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); + curl_setopt($curl, CURLOPT_HTTPHEADER, ['Content-Type: application/json']); curl_exec($curl); curl_close($curl);