瀏覽代碼

Set baseURL properly in Postman collection

shalvah 4 年之前
父節點
當前提交
1cd727fbe2
共有 1 個文件被更改,包括 1 次插入18 次删除
  1. 1 18
      src/Writing/PostmanCollectionWriter.php

+ 1 - 18
src/Writing/PostmanCollectionWriter.php

@@ -26,7 +26,7 @@ class PostmanCollectionWriter
     public function __construct(DocumentationConfig $config = null)
     {
         $this->config = $config ?: new DocumentationConfig(config('scribe', []));
-        $this->baseUrl = $this->getBaseUrl($this->config->get('postman.base_url', $this->config->get('base_url')));
+        $this->baseUrl = $this->config->get('postman.base_url', $this->config->get('base_url'));
     }
 
     public function generatePostmanCollection(Collection $groupedEndpoints)
@@ -256,23 +256,6 @@ class PostmanCollectionWriter
         return $base;
     }
 
-    protected function getBaseUrl($baseUrl)
-    {
-        try {
-            if (Str::contains(app()->version(), 'Lumen')) { //Is Lumen
-                $reflectionMethod = new ReflectionMethod(\Laravel\Lumen\Routing\UrlGenerator::class, 'getRootUrl');
-                $reflectionMethod->setAccessible(true);
-                $url = app('url');
-
-                return $reflectionMethod->invokeArgs($url, ['', $baseUrl]);
-            }
-
-            return URL::formatRoot('', $baseUrl);
-        } catch (\Throwable $e) {
-            return $baseUrl;
-        }
-    }
-
     private function getAuthParamToExclude(): array
     {
         if (!$this->config->get('auth.enabled')) {