update api

This commit is contained in:
2026-02-20 23:52:38 +07:00
parent 1dfcf9b2f5
commit c19e39fe5e
13 changed files with 628 additions and 16 deletions
+14
View File
@@ -3,6 +3,7 @@
namespace App\Models\Map;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
class Tanaman extends Model
{
@@ -22,4 +23,17 @@ class Tanaman extends Model
'updated_by',
'deleted_by',
];
protected function casts(): array
{
return [
'kondisi_tanaman' => \App\Enums\KondisiTanaman::class,
];
}
public function komoditas()
{
return $this->belongsTo(Komoditas::class, 'komoditas_id');
}
}
+2 -2
View File
@@ -12,8 +12,8 @@ class DesaKelurahan extends Model
protected $table = 'master_desa_kelurahan';
protected $fillable = [
'kode_desa_kelurahan',
'nama_desa_kelurahan',
'kode',
'nama',
'path',
'kecamatan_id',
];
+2 -2
View File
@@ -12,8 +12,8 @@ class KabupatenKota extends Model
protected $table = 'master_kabupaten_kota';
protected $fillable = [
'kode_kabupaten_kota',
'nama_kabupaten_kota',
'kode',
'nama',
'path',
'provinsi_id',
];
+2 -2
View File
@@ -12,8 +12,8 @@ class Kecamatan extends Model
protected $table = 'master_kecamatan';
protected $fillable = [
'kode_kecamatan',
'nama_kecamatan',
'kode',
'nama',
'path',
'kabupaten_kota_id',
];
+2 -2
View File
@@ -12,8 +12,8 @@ class Provinsi extends Model
protected $table = 'master_provinsi';
protected $fillable = [
'kode_provinsi',
'nama_provinsi',
'kode',
'nama',
'path',
'iso',
];