Basic signup for events

This commit is contained in:
2026-03-21 21:02:15 +01:00
parent 23af267896
commit b8341890d3
74 changed files with 4046 additions and 947 deletions

View File

@@ -0,0 +1,33 @@
<?php
namespace App\Resources;
use App\Models\EventParticipant;
use Illuminate\Http\Resources\Json\JsonResource;
class EventParticipantResource extends JsonResource
{
function __construct(EventParticipant $participant)
{
parent::__construct($participant);
}
public function toArray($request) : array
{
$event = $this->resource->event;
return array_merge(
$this->resource->toArray(),
[
'needs_payment' => $this->resource->amount->getAmount() > 0 && $event->pay_direct,
'nicename' => $this->resource->getNicename(),
'arrival' => $this->resource->arrival_date->format('d.m.Y'),
'departure' => $this->resource->departure_date->format('d.m.Y'),
'amount_left_string' => $this->resource->amount->toString(),
]
);
}
}