Skip to content

Commit

Permalink
Final cleanups
Browse files Browse the repository at this point in the history
  • Loading branch information
shalvah committed Sep 8, 2022
1 parent 4b37c2a commit 92c1281
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 15 deletions.
7 changes: 2 additions & 5 deletions routes/laravel.php
Original file line number Diff line number Diff line change
Expand Up @@ -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', []);
Expand All @@ -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');
});
22 changes: 12 additions & 10 deletions src/Commands/Upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 <info>public ?ExtractedEndpointData $endpointData;</info>.');
$this->line('2. Replace the <info>array $routeRules</info> parameter in __invoke() with <info>array $routeRules = []</info> .');
}
$this->newLine();
if (!($this->option('dry-run'))) {
if ($this->confirm("Do you have any custom strategies?")) {
$this->line('1. Add a new property <info>public ?ExtractedEndpointData $endpointData;</info>.');
$this->line('2. Replace the <info>array $routeRules</info> parameter in __invoke() with <info>array $routeRules = []</info> .');
}
$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 <href=https://scribe.knuckles.wtf/blog/laravel-v4>http://scribe.knuckles.wtf/blog/laravel-v4</> for the full upgrade guide!");
}
Expand Down

0 comments on commit 92c1281

Please sign in to comment.