<?php

namespace App\Resources;

use App\Enumerations\ParticipationType;
use Illuminate\Http\Request;
use Illuminate\Http\Resources\Json\JsonResource;

class ParticipationTypeResource extends JsonResource
{
    public function __construct(private ParticipationType $participationType) {}
    /**
     * Transform the resource into an array.
     *
     * @return array<string, mixed>
     */
    public function toArray(Request $request): array
    {
        return ['slug' => $this->participationType->slug, 'name' => $this->participationType->name];
    }
}
