45 lines
889 B
PHP
45 lines
889 B
PHP
<?php
|
|
|
|
namespace App\Models\Pertanian;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use App\Models\User;
|
|
use App\Models\Pertanian\Petani;
|
|
|
|
class HargaJualPanen extends Model
|
|
{
|
|
protected $table = 'harga_jual_panen';
|
|
|
|
protected $fillable = [
|
|
'uid',
|
|
'petani_id',
|
|
'bentuk_produk',
|
|
'harga_panen_terakhir',
|
|
'harga_tahun_lalu',
|
|
'harga_dua_tahun_lalu',
|
|
'created_by',
|
|
'updated_by',
|
|
'deleted_by',
|
|
];
|
|
|
|
|
|
public function petani()
|
|
{
|
|
return $this->belongsTo(Petani::class, 'petani_id');
|
|
}
|
|
|
|
public function creator()
|
|
{
|
|
return $this->belongsTo(User::class, 'created_by');
|
|
}
|
|
|
|
public function updater()
|
|
{
|
|
return $this->belongsTo(User::class, 'updated_by');
|
|
}
|
|
|
|
public function deleter()
|
|
{
|
|
return $this->belongsTo(User::class, 'deleted_by');
|
|
}
|
|
} |