*/ protected $fillable = [ 'number', 'status', 'shipping_method', 'shipping_price', 'payment_type_id', 'notes', 'customer_name', 'customer_phone', 'customer_address', 'delivery_time', 'delivery_at', 'region', 'user_id', 'additional_tax', 'province_id', 'source_app', ]; /** * The attributes that should be cast. */ protected $casts = [ 'delivery_at' => 'date', ]; /** * User (customer) */ public function user(): BelongsTo { return $this->belongsTo(User::class); } /** * Related Province */ public function province(): BelongsTo { return $this->belongsTo(Province::class); } /** * Order items */ public function items(): HasMany { return $this->hasMany(OrderItem::class); } /** * Payment types */ public function paymentType(): BelongsTo { return $this->belongsTo(PaymentType::class, 'payment_type_id'); } }