瀏覽代碼

Update PostmanCollectionWriter.php

in my config for headers I have @{{token}} which in the views shows up as {{token}}, but I want to use {{token}} in collection for postman w/out having to search/replace. So the solution was this.
Patrick Curl 5 年之前
父節點
當前提交
dd324a7225
共有 1 個文件被更改,包括 2 次插入0 次删除
  1. 2 0
      src/Writing/PostmanCollectionWriter.php

+ 2 - 0
src/Writing/PostmanCollectionWriter.php

@@ -106,6 +106,8 @@ class PostmanCollectionWriter
                 'Accept' => 'application/json',
             ])
             ->map(function ($value, $header) {
+                // Fix so in config we can have @{{ for blade views but it'll use {{ for postman for env vars. 
+                $value = str_replace('@{{', '{{', $value);
                 return [
                     'key' => $header,
                     'value' => $value,