'Заказано', 'in_stock' => 'На складе', 'shipped' => 'Отгружено', ]; protected $casts = [ 'with_documents' => 'boolean', 'ordered_quantity' => 'integer', 'available_qty' => 'integer', ]; /** * Статус на русском языке */ public function getStatusNameAttribute(): string { return self::STATUS_NAMES[$this->status] ?? $this->status; } /** * С документами - да/нет */ public function getWithDocumentsTextAttribute(): string { return $this->with_documents ? 'Да' : 'Нет'; } /** * @deprecated Используйте available_qty */ public function getRemainingQuantityAttribute(): int { return $this->available_qty ?? 0; } }