add family logic
This commit is contained in:
+5
-2
@@ -2,6 +2,7 @@
|
||||
|
||||
use Illuminate\Support\Facades\Route;
|
||||
use App\Http\Controllers\View\DashboardRedirectController;
|
||||
use App\Services\Docs\OpenApiRouteExporter;
|
||||
|
||||
Route::redirect('/', '/api/docs')->name('docs.home');
|
||||
Route::view('/api/docs', 'docs.swagger')->name('docs.swagger');
|
||||
@@ -11,8 +12,10 @@ Route::get('/api/documentation/swagger.json', function () {
|
||||
$path = resource_path('docs/openapi.json');
|
||||
abort_unless(is_file($path), 404);
|
||||
|
||||
return response()->file($path, [
|
||||
$spec = app(OpenApiRouteExporter::class)->exportFromFile($path);
|
||||
|
||||
return response()->json($spec, 200, [
|
||||
'Content-Type' => 'application/json',
|
||||
'Cache-Control' => 'public, max-age=300',
|
||||
'Cache-Control' => 'no-store, max-age=0',
|
||||
]);
|
||||
})->name('docs.swagger-json');
|
||||
|
||||
Reference in New Issue
Block a user