ldc-showroom-bo/routes/web-fo.php
2025-05-27 09:11:43 +02:00

26 lines
876 B
PHP

<?php
use App\Lib\Helpers\ToolboxHelper;
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');
}
// * 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');
});