26 lines
876 B
PHP
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');
|
|
});
|