jenis_komoditas model,api controller dan resources

This commit is contained in:
2026-06-03 15:05:52 +07:00
parent 7cc3e0e8f1
commit b15504e009
5 changed files with 226 additions and 2 deletions
@@ -0,0 +1,26 @@
<?php
namespace App\Http\Resources\Pertanian;
use Illuminate\Http\Request;
use Illuminate\Http\Resources\Json\JsonResource;
class JenisKomoditasResource extends JsonResource
{
/**
* Transform the resource into an array.
*
* @return array<string, mixed>
*/
public function toArray(Request $request): array
{
return [
'id' => $this->id,
'nama' => $this->nama,
'kode' => $this->kode,
'keterangan' => $this->keterangan,
'created_at' => $this->created_at?->toIso8601String(),
'updated_at' => $this->updated_at?->toIso8601String(),
];
}
}