ldc-showroom-bo/routes/web-fo.php

27 lines
876 B
PHP
Raw Permalink Normal View History

2024-01-05 11:28:16 +01:00
<?php
2024-01-08 15:28:00 +01:00
use App\Lib\Helpers\ToolboxHelper;
2024-01-05 11:28:16 +01:00
use Illuminate\Support\Facades\Route;
Route::middleware(['throttle:credentials'])
->name('fo.')
->group(function () {
// * Dev route only
if (app()->environment() === 'local') {
Route::view('/bs-demo', 'fo.pages.bs-demo')->name('bs-demo');
}
2024-01-08 15:28:00 +01:00
// * Schema File
Route::get('schemas/{schema}', function (string $schema) {
$schemaContent = ToolboxHelper::getJsonSchema($schema);
if ($schemaContent === false) {
abort(404);
}
return response()->json($schemaContent, 200, [
'Content-Type' => 'application/schema+json'
]);
})->middleware('throttle:30,1')->where('schema', '[a-z]{1,}\.schema\.json')->name('schema');
Route::redirect('/', '/bo')->name('homepage');
2024-01-05 11:28:16 +01:00
});