*/ protected $fillable = [ 'customer_id', 'status', 'total', 'payment_status', 'notes', ]; /** * Get the customer that owns the order. */ public function customer() { return $this->belongsTo(User::class, 'customer_id'); } /** * Get the products for the order. */ public function products() { return $this->belongsToMany(Product::class, 'order_products') ->withPivot('quantity', 'price', 'total') ->withTimestamps(); } }