Files
2026-06-25 14:50:27 +07:00

37 lines
783 B
PHP

<?php
namespace App\Models\Map;
use Illuminate\Database\Eloquent\Relations\Pivot;
use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
class PanenKomoditas extends Pivot
{
use SoftDeletes;
protected $table = 'panen_komoditas';
// Penting agar ID auto-increment di tabel pivot terbaca oleh Laravel
public $incrementing = true;
protected $fillable = [
'uid',
'panen_id',
'tanaman_id',
'komoditas_id',
'berat_kg',
'sync_status',
];
public function panen(): BelongsTo
{
return $this->belongsTo(Panen::class, 'panen_id');
}
public function tanaman(): BelongsTo
{
return $this->belongsTo(Tanaman::class, 'plant_id');
}
}