Bläddra i källkod

Rename Postman collection route to `cribe.postman`.

shalvah 4 år sedan
förälder
incheckning
d745c4ed59
2 ändrade filer med 2 tillägg och 2 borttagningar
  1. 1 1
      routes/laravel.php
  2. 1 1
      src/Writing/Writer.php

+ 1 - 1
routes/laravel.php

@@ -9,6 +9,6 @@ Route::namespace('\Knuckles\Scribe\Http')
     ->middleware($middleware)
     ->group(function () use ($prefix) {
         Route::get($prefix, 'Controller@webpage')->name('scribe');
-        Route::get("$prefix.json", 'Controller@postman')->name('scribe.json'); // todo rename to scribe.postman in future versions
+        Route::get("$prefix.json", 'Controller@postman')->name('scribe.postman');
         Route::get("$prefix.openapi", 'Controller@openapi')->name('scribe.openapi');
     });

+ 1 - 1
src/Writing/Writer.php

@@ -262,7 +262,7 @@ class Writer
         // Rewrite links to go through Laravel
         $contents = preg_replace('#href="css/(.+?)"#', 'href="{{ asset("vendor/scribe/css/$1") }}"', $contents);
         $contents = preg_replace('#src="(js|images)/(.+?)"#', 'src="{{ asset("vendor/scribe/$1/$2") }}"', $contents);
-        $contents = str_replace('href="./collection.json"', 'href="{{ route("scribe.json") }}"', $contents);
+        $contents = str_replace('href="./collection.json"', 'href="{{ route("scribe.postman") }}"', $contents);
         $contents = str_replace('href="./openapi.yaml"', 'href="{{ route("scribe.openapi") }}"', $contents);
 
         file_put_contents("$this->laravelTypeOutputPath/index.blade.php", $contents);