'decimal:2', 'items_count' => 'integer', ]; } public function user() { return $this->belongsTo(User::class); } public function items() { return $this->hasMany(OrderItem::class); } public function getPaymentMethodLabelAttribute(): string { return match ($this->payment_method) { 'card_transfer' => __('Перевод по реквизитам (на карту)'), default => __('Не указан'), }; } public function getStatusLabelAttribute(): string { return match ($this->status) { 'new' => __('Новый'), 'processing' => __('В обработке'), 'paid' => __('Оплачен'), 'shipped' => __('Отправлен'), 'completed' => __('Завершен'), 'cancelled' => __('Отменен'), default => (string) $this->status, }; } }