<?php

namespace App\Resources;

use App\Enumerations\EatingHabit;
use Illuminate\Http\Resources\Json\JsonResource;

class EatingHabitResource extends JsonResource {
    private EatingHabit $eatingHabit;

    public function __construct(EatingHabit $eatingHabit) {
        $this->eatingHabit = $eatingHabit;
    }

    public function toArray($request) : array {
        return [
            'id' => $this->eatingHabit->id,
            'slug' => $this->eatingHabit->slug,
            'name' => $this->eatingHabit->name
        ];
    }
}
