Skip to content

Commit 057cb0b

Browse files
committed
Allow configurable route
1 parent 41a71fc commit 057cb0b

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

config/db-doc.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,7 @@
1919
'view' => null,
2020
],
2121
],
22+
'middleware' => [
23+
'auth',
24+
],
2225
];

src/LaravelDbDoc.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@ public static function routes()
1212
{
1313
if (app()->environment() != 'production') {
1414
Route::get('doc/db-schema', function () {
15-
// Todo: define role
16-
1715
$format = request()->query('format', 'markdown');
1816
$content = self::content($format);
1917

@@ -28,7 +26,9 @@ public static function routes()
2826
$content
2927
),
3028
]);
31-
})->middleware('auth', 'verified')->name('doc.db-schema');
29+
})->middleware(
30+
config('db-doc.middleware')
31+
)->name('doc.db-schema');
3232
}
3333
}
3434

0 commit comments

Comments
 (0)