<?php

namespace Seka\Vzdelavanie\Http\Resources;

use Illuminate\Http\Resources\Json\JsonResource;

/**
 * Class OblubeneResource
 * @package Seka\Vzdelavanie\Http\Resources
 */
class OblubeneResource extends JsonResource
{
    use HideResourceFieldsTrait;

    /**
     * Transform the resource into an array.
     *
     * @param  \Illuminate\Http\Request  $request
     * @return array
     */
    public function toArray($request): array
    {
        return $this->filterFields([
            'id' => (int) $this->id,
            'hash_id' => $this->hash_id,
            'oblubene_id' => $this->oblubene_id,
            'oblubene_type' => $this->oblubene_type,
            'datum_vytvorenia' => (string) $this->created_at,
            'datum_zmeny' => (string) $this->updated_at,
        ]);
    }
}
