tabel ekosistem
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
<?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')),
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -29,6 +29,7 @@ class TabelBasisDataResource extends JsonResource
|
||||
// 'group' => new GroupBasisDataResource($this->whenLoaded('group')),
|
||||
'kolom' => KolomBasisDataResource::collection($this->whenLoaded('kolom')),
|
||||
//'ringkasan' => RingkasanBasisDataResource::collection($this->whenLoaded('ringkasan')),
|
||||
'form' => FormBasisDataResource::collection($this->whenLoaded('form')),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user