Closed jackkitley closed 1 year ago
Issue is that the route generated is not dynamic to the config set.
` $prefix = config('scribe_mobile.laravel.docs_url', '/docs'); $middleware = config('scribe_mobile.laravel.middleware', []);
Route::middleware($middleware) ->group(function () use ($prefix) { Route::view($prefix, 'scribe.index')->name('scribe');
Route::get("$prefix.postman", function () {
return new JsonResponse(Storage::disk('local')->get('scribe/collection.json'), json: true);
})->name('scribe_mobile.postman');
Route::get("$prefix.openapi", function () {
return response()->file(Storage::disk('local')->path('scribe/openapi.yaml'));
})->name('scribe_mobile.openapi');
});
`
It's stated in the docs:
Maybe I should move it to the beginning of the section so it's more obvious?
Thanks.
Because I looked in vendor and saw config this was my immediate thought to create another configuration and it would automatically work.
I'll give this a try.
On Fri, 09 Jun 2023, 17:51 Shalvah, @.***> wrote:
It's stated in the docs:
[image: Screenshot_20230609-164939~2] https://user-images.githubusercontent.com/14361073/244743032-f3a63cdb-769a-4565-b761-5b115bfa048c.png
Maybe I should move it to the beginning of the section so it's more obvious?
— Reply to this email directly, view it on GitHub https://github.com/knuckleswtf/scribe/issues/682#issuecomment-1584801074, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAYXYBUX65UPNYTOMXG4T63XKNBADANCNFSM6AAAAAAZAP62MY . You are receiving this because you authored the thread.Message ID: @.***>
@shalvah I tried what was described in docs and i tried this way in routes before the other issues and i get the following:
If i set both to false in config then all works.
Had to add two more routes to get openapi and postman.
Route::view('/mobile/docs', 'scribe_mobile.index')->name('scribe-mobile'); Route::get("scribe_mobile.postman", function () { return new JsonResponse(Storage::disk('local')->get('scribe_mobile/collection.json'), json: true); })->name('scribe_mobile.postman'); Route::get("scribe_mobile.openapi", function () { return response()->file(Storage::disk('local')->path('scribe_mobile/openapi.yaml')); })->name('scribe_mobile.openapi');
Scribe version
4.21.2
PHP version
8.2.6
Framework
Laravel
Framework version
10.13.2
Scribe config
What happened?
php artisan scribe:config --config=mobile_scribe
I created another config to generate another doc to separate my routes for mobile.
It doesnt generate the routes for
laravel
. 404 not found.Docs