ekosistem dan framework
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;
|
||||
|
||||
class KolomBasisDataResource extends JsonResource
|
||||
{
|
||||
/**
|
||||
* Transform the resource into an array.
|
||||
*
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
public function toArray(Request $request): array
|
||||
{
|
||||
return [
|
||||
'id' => $this->id,
|
||||
'label' => $this->label,
|
||||
'kolom' => $this->kolom,
|
||||
'tipe' => $this->tipe,
|
||||
'validasi' => $this->validasi,
|
||||
'urutan' => $this->urutan,
|
||||
'relasi_tabel' => $this->relasi_tabel,
|
||||
'relasi_kolom_id' => $this->relasi_kolom_id,
|
||||
'relasi_kolom_label' => $this->relasi_kolom_label,
|
||||
'enum_opsi' => $this->enum_opsi,
|
||||
'is_active' => $this->is_active,
|
||||
'is_browse' => $this->is_browse,
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Resources\Ekosistem;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Http\Resources\Json\JsonResource;
|
||||
|
||||
use App\Models\Ekosistem\TabelBasisData;
|
||||
use App\Models\Ekosistem\KolomBasisData;
|
||||
use App\Http\Resources\Ekosistem\KolomBasisDataResource;
|
||||
|
||||
class TabelBasisDataResource extends JsonResource
|
||||
{
|
||||
/**
|
||||
* Transform the resource into an array.
|
||||
*
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
public function toArray(Request $request): array
|
||||
{
|
||||
return [
|
||||
'id' => $this->id,
|
||||
'tabel' => $this->tabel,
|
||||
'label' => $this->label,
|
||||
'menu' => $this->menu,
|
||||
'deskripsi' => $this->deskripsi,
|
||||
// 'group_id' => $this->group_id,
|
||||
'urutan' => $this->urutan,
|
||||
// 'group' => new GroupBasisDataResource($this->whenLoaded('group')),
|
||||
'kolom' => KolomBasisDataResource::collection($this->whenLoaded('kolom')),
|
||||
//'ringkasan' => RingkasanBasisDataResource::collection($this->whenLoaded('ringkasan')),
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Resources\Ekosistem;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Http\Resources\Json\JsonResource;
|
||||
|
||||
class ValueBasisDataResource extends JsonResource
|
||||
{
|
||||
/**
|
||||
* Transform the resource into an array.
|
||||
*
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
public function toArray(Request $request): array
|
||||
{
|
||||
return [
|
||||
'id' => $this->id,
|
||||
'program_id' => $this->program_id,
|
||||
'tabel_id' => $this->tabel_id,
|
||||
'kolom_id' => $this->kolom_id,
|
||||
'value_id' => $this->value_id,
|
||||
'value_varchar' => $this->value_varchar,
|
||||
'value_integer' => $this->value_integer,
|
||||
'value_float' => $this->value_float,
|
||||
'value_boolean' => $this->value_boolean,
|
||||
'value_date' => $this->value_date,
|
||||
'value_datetime' => $this->value_datetime,
|
||||
'value_text' => $this->value_text,
|
||||
'value_relasi' => $this->value_relasi,
|
||||
'value_enum' => $this->value_enum,
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user