update wilayah dan pertanian

This commit is contained in:
2026-04-06 13:27:37 +07:00
parent 167cf5c680
commit 502c3be5bf
11 changed files with 332 additions and 139 deletions
@@ -0,0 +1,29 @@
<?php
namespace App\Http\Resources\Pertanian;
use Illuminate\Http\Request;
use Illuminate\Http\Resources\Json\JsonResource;
use App\Http\Resources\Wilayah\DesaKelurahanResource;
class TanamanResource 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,
'komoditas' => $this->komoditas ? new KomoditasResource($this->komoditas) : null,
'profile_id' => $this->profile_id,
'lahan' => $this->lahan ? new LahanResource($this->lahan) : null,
'latitude' => $this->latitude,
'longitude' => $this->longitude,
'kondisi_tanaman' => $this->kondisi_tanaman,
];
}
}