diff --git a/routes/laravel.php b/routes/laravel.php
index 83bcf151..ce9924f0 100644
--- a/routes/laravel.php
+++ b/routes/laravel.php
@@ -3,7 +3,6 @@
use Illuminate\Http\JsonResponse;
use Illuminate\Support\Facades\Route;
use Illuminate\Support\Facades\Storage;
-use Symfony\Component\HttpFoundation\BinaryFileResponse;
$prefix = config('scribe.laravel.docs_url', '/docs');
$middleware = config('scribe.laravel.middleware', []);
@@ -13,12 +12,10 @@
Route::view($prefix, 'scribe.index')->name('scribe');
Route::get("$prefix.postman", function () {
- return new JsonResponse(
- Storage::disk('local')->get('scribe/collection.json'), json: true
- );
+ return new JsonResponse(Storage::disk('local')->get('scribe/collection.json'), json: true);
})->name('scribe.postman');
Route::get("$prefix.openapi", function () {
- return new BinaryFileResponse(Storage::disk('local')->path('scribe/openapi.yaml'));
+ return response()->file(Storage::disk('local')->path('scribe/openapi.yaml'));
})->name('scribe.openapi');
});
diff --git a/src/Commands/Upgrade.php b/src/Commands/Upgrade.php
index aabb126f..91898ea3 100644
--- a/src/Commands/Upgrade.php
+++ b/src/Commands/Upgrade.php
@@ -62,22 +62,24 @@ public function handle(): void
return;
}
- $this->upgradeToV4();
+ $this->finishV4Upgrade();
}
- protected function upgradeToV4(): void
+ protected function finishV4Upgrade(): void
{
- if ($this->confirm("Do you have any custom strategies?")) {
- $this->line('1. Add a new property public ?ExtractedEndpointData $endpointData;.');
- $this->line('2. Replace the array $routeRules parameter in __invoke() with array $routeRules = [] .');
- }
- $this->newLine();
+ if (!($this->option('dry-run'))) {
+ if ($this->confirm("Do you have any custom strategies?")) {
+ $this->line('1. Add a new property public ?ExtractedEndpointData $endpointData;.');
+ $this->line('2. Replace the array $routeRules parameter in __invoke() with array $routeRules = [] .');
+ }
+ $this->newLine();
- if ($this->confirm("Did you customize the Blade templates used by Scribe?")) {
- $this->warn('A few minor changes were made to the templates. See the release announcement for details.');
+ if ($this->confirm("Did you customize the Blade templates used by Scribe?")) {
+ $this->warn('A few minor changes were made to the templates. See the release announcement for details.');
+ }
+ $this->newLine();
}
- $this->newLine();
$this->info("✔ Done.");
$this->line("See the release announcement at http://scribe.knuckles.wtf/blog/laravel-v4> for the full upgrade guide!");
}