<?php

namespace Modules\Internal\Transformers;

use Illuminate\Http\Resources\Json\JsonResource;

class CorporateFormulariumResource extends JsonResource
{
    /**
     * Transform the resource into an array.
     *
     * @param  \Illuminate\Http\Request
     * @return array
     */
    public function toArray($request)
    {
        return [
            'id' => $this->id,
            'formulaurium_category_id' => $this->formularium_template->id,
            'category' => $this->formularium_template->name,
            'description' => $this->formularium_template->description,
            'active' => $this->active == 1 ? 'Active' : 'Inactive',
        ];
    }
}
