31 lines
938 B
PHP
31 lines
938 B
PHP
<?php
|
|
|
|
namespace App\Models\Distribusi;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\SoftDeletes;
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
|
|
class Distribution extends Model
|
|
{
|
|
use HasFactory, SoftDeletes;
|
|
|
|
protected $table = 'distribusi';
|
|
|
|
// Karena id adalah BIGINT auto-increment, default Laravel sudah benar (incrementing = true)
|
|
protected $fillable = [
|
|
'petani_id','panen_uid', 'nama_pengirim', 'offtaker_id', 'nama_offtaker',
|
|
'komoditas_id', 'berat_kg', 'grade_petani', 'grade_offtaker',
|
|
'alasan', 'harga_per_kg', 'total',
|
|
'tgl_distribusi', 'tgl_terima', 'catatan', 'status',
|
|
'sync_status', 'created_date', 'updated_date',
|
|
];
|
|
|
|
protected $casts = [
|
|
'berat_kg' => 'float',
|
|
'harga_per_kg' => 'float',
|
|
'total' => 'float',
|
|
'created_date' => 'datetime',
|
|
'updated_date' => 'datetime',
|
|
];
|
|
} |