wi-adrema-plugin/routes.php

14 lines
346 B
PHP
Raw Normal View History

2024-01-31 22:33:35 +01:00
<?php
2024-02-01 01:58:40 +01:00
use Silva\Adrema\Support\FetchAllEvents;
2024-01-31 22:33:35 +01:00
Route::get('/api/silva_adrema_event_overview', function () {
2024-02-01 01:58:40 +01:00
$events = app(FetchAllEvents::class)->run();
2024-01-31 22:33:35 +01:00
2024-02-01 01:58:40 +01:00
if (is_null($events)) {
2024-01-31 22:33:35 +01:00
return Response::json(['message' => 'Fehler beim Laden der Veranstaltungen'], 422);
}
2024-02-01 01:58:40 +01:00
return Response::json($events);
2024-01-31 22:33:35 +01:00
})->middleware('api');