<?php 

namespace App\Http\Resources\Consumable;

use Illuminate\Http\Resources\Json\JsonResource;
use App\Models\User;
use App\Http\Resources\BaseJsonResource;

class ConsumableConsumpationResource extends BaseJsonResource
{
    public function toArray($request)
    {

        $array = [
            'id' => $this->id,
            'name' => $this->name,
            'change_date' => $this->change_date,
            'change_reason' => $this->change_reason,
            'narration' => $this->narration,
            'detail' => ConsumableConsumpationDetailResource::collection($this->consumptionDetail())
        ];

        //$array = $this->base($array);
        
        return $array;
    }
}