2025-11-13 13:05:17 +05:30
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace App\Models;
|
|
|
|
|
|
|
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
2025-12-01 10:38:52 +05:30
|
|
|
use Illuminate\Database\Eloquent\SoftDeletes;
|
2025-11-13 13:05:17 +05:30
|
|
|
|
|
|
|
|
class OrderItem extends Model
|
|
|
|
|
{
|
2025-12-01 10:38:52 +05:30
|
|
|
use HasFactory, SoftDeletes;
|
2025-11-13 13:05:17 +05:30
|
|
|
|
|
|
|
|
protected $fillable = [
|
|
|
|
|
'order_id',
|
|
|
|
|
'description',
|
|
|
|
|
'ctn',
|
|
|
|
|
'qty',
|
|
|
|
|
'ttl_qty',
|
|
|
|
|
'unit',
|
|
|
|
|
'price',
|
|
|
|
|
'ttl_amount',
|
|
|
|
|
'cbm',
|
|
|
|
|
'ttl_cbm',
|
|
|
|
|
'kg',
|
|
|
|
|
'ttl_kg',
|
|
|
|
|
'shop_no',
|
|
|
|
|
'meta',
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
protected $casts = [
|
|
|
|
|
'meta' => 'array',
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
// Link to parent order
|
|
|
|
|
public function order()
|
|
|
|
|
{
|
|
|
|
|
return $this->belongsTo(Order::class);
|
|
|
|
|
}
|
|
|
|
|
}
|