distribusi
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
<?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');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user