Skip to content

Commit

Permalink
feat: dont generate routes if url is not specified in configs
Browse files Browse the repository at this point in the history
  • Loading branch information
Mohammad-Alavi committed Mar 15, 2023
1 parent 9734050 commit 600b3b2
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
16 changes: 9 additions & 7 deletions UI/WEB/Routes/GetPrivateDocumentation.v1.private.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@
use App\Containers\Vendor\Documentation\UI\WEB\Controllers\Controller;
use Illuminate\Support\Facades\Route;

if (config('vendor-documentation.protect-private-docs')) {
Route::get(config('vendor-documentation.types.private.url'), [Controller::class, 'showPrivateDocs'])
->name('private_docs')
->middleware('auth:web');
} else {
Route::get(config('vendor-documentation.types.private.url'), [Controller::class, 'showPrivateDocs'])
->name('private_docs');
if (config('vendor-documentation.types.private.url')) {
if (config('vendor-documentation.protect-private-docs')) {
Route::get(config('vendor-documentation.types.private.url'), [Controller::class, 'showPrivateDocs'])
->name('private_docs')
->middleware('auth:web');
} else {
Route::get(config('vendor-documentation.types.private.url'), [Controller::class, 'showPrivateDocs'])
->name('private_docs');
}
}
6 changes: 4 additions & 2 deletions UI/WEB/Routes/GetPublicDocumentation.v1.public.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,7 @@
use App\Containers\Vendor\Documentation\UI\WEB\Controllers\Controller;
use Illuminate\Support\Facades\Route;

Route::get(config('vendor-documentation.types.public.url'), [Controller::class, 'showPublicDocs'])
->name('public_docs');
if (config('vendor-documentation.types.public.url')) {
Route::get(config('vendor-documentation.types.public.url'), [Controller::class, 'showPublicDocs'])
->name('public_docs');
}

0 comments on commit 600b3b2

Please sign in to comment.