27 lines
959 B
PHP
27 lines
959 B
PHP
<?php
|
|
|
|
namespace App\Http\Controllers\Api\V1;
|
|
|
|
use App\Http\Controllers\Controller;
|
|
use App\Models\Event;
|
|
|
|
class EventController extends Controller
|
|
{
|
|
public function show(Event $event)
|
|
{
|
|
// Minimal payload; extend as needed.
|
|
return response()->json([
|
|
'id' => $event->id,
|
|
'name' => $event->name,
|
|
'date' => optional($event->date)->toDateString(),
|
|
'venue' => $event->venue,
|
|
'shotgun_mode' => (bool) $event->shotgun_mode,
|
|
'courses' => $event->courses_json,
|
|
'registration_open_at' => optional($event->registration_open_at)->toIso8601String(),
|
|
'registration_close_at' => optional($event->registration_close_at)->toIso8601String(),
|
|
'pairing_finalized_at' => optional($event->pairing_finalized_at)->toIso8601String(),
|
|
'pairing_published_at' => optional($event->pairing_published_at)->toIso8601String(),
|
|
]);
|
|
}
|
|
}
|