update api
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\Map;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
|
||||
class Lahan extends Model
|
||||
{
|
||||
use SoftDeletes;
|
||||
|
||||
protected $table = 'map_lahan';
|
||||
|
||||
protected $fillable = [
|
||||
'nama',
|
||||
'status_kepemilikan',
|
||||
'profile_id',
|
||||
'desa_kelurahan_id',
|
||||
'path',
|
||||
'luas_lahan',
|
||||
'created_by',
|
||||
'updated_by',
|
||||
'deleted_by',
|
||||
];
|
||||
|
||||
protected function casts(): array
|
||||
{
|
||||
return [
|
||||
'status_kepemilikan' => \App\Enums\StatusLahan::class,
|
||||
];
|
||||
}
|
||||
|
||||
public function tanaman(): HasMany
|
||||
{
|
||||
return $this->hasMany(Tanaman::class, 'lahan_id');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\Map;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Tanaman extends Model
|
||||
{
|
||||
use SoftDeletes;
|
||||
|
||||
protected $table = 'map_tanaman';
|
||||
|
||||
protected $fillable = [
|
||||
'nama',
|
||||
'komoditas_id',
|
||||
'profile_id',
|
||||
'lahan_id',
|
||||
'latitude',
|
||||
'longitude',
|
||||
'kondisi_tanaman',
|
||||
'created_by',
|
||||
'updated_by',
|
||||
'deleted_by',
|
||||
];
|
||||
}
|
||||
Reference in New Issue
Block a user