initial commit
This commit is contained in:
@@ -6,5 +6,27 @@ use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class WeightHistory extends Model
|
||||
{
|
||||
//
|
||||
}
|
||||
// Pastikan fillable sesuai dengan kolom di database
|
||||
protected $fillable = [
|
||||
'cat_id',
|
||||
'berat',
|
||||
'tanggal_timbang', // Pastikan baris ini ada
|
||||
'created_at',
|
||||
'updated_at'
|
||||
];
|
||||
|
||||
|
||||
|
||||
protected function casts(): array
|
||||
{
|
||||
return [
|
||||
'tanggal_timbang' => 'date',
|
||||
'berat' => 'decimal:2',
|
||||
];
|
||||
}
|
||||
|
||||
public function cat()
|
||||
{
|
||||
return $this->belongsTo(Cat::class);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user