33 lines
938 B
PHP
33 lines
938 B
PHP
<?php
|
|
|
|
namespace App\Http\Resources\Ekosistem;
|
|
|
|
use Illuminate\Http\Request;
|
|
use Illuminate\Http\Resources\Json\JsonResource;
|
|
|
|
use App\Http\Resources\Ekosistem\KolomBasisDataResource;
|
|
|
|
class FormBasisDataResource extends JsonResource
|
|
{
|
|
/**
|
|
* Transform the resource into an array.
|
|
*
|
|
* @return array<string, mixed>
|
|
*/
|
|
public function toArray(Request $request): array
|
|
{
|
|
return [
|
|
'id' => $this->id,
|
|
'tabel_id' => $this->tabel_id,
|
|
'parent_id' => $this->parent_id,
|
|
'tipe' => $this->tipe,
|
|
'column_width' => $this->column_width,
|
|
'kolom_id' => $this->kolom_id,
|
|
'section_label' => $this->section_label,
|
|
'urutan' => $this->urutan,
|
|
'kolom' => new KolomBasisDataResource($this->whenLoaded('kolom')),
|
|
'form' => FormBasisDataResource::collection($this->whenLoaded('form')),
|
|
];
|
|
}
|
|
}
|