'integer', 'unit_price' => 'decimal:2', 'line_total' => 'decimal:2', 'metadata' => 'array', 'created_at' => 'datetime', ]; // Relationships public function order(): BelongsTo { return $this->belongsTo(Order::class); } public function package(): BelongsTo { return $this->belongsTo(Package::class, 'item_id') ->where('item_type', 'package'); } // Helpers public function isPackage(): bool { return $this->item_type === 'package'; } public function isAddon(): bool { return $this->item_type === 'addon'; } public function isBoost(): bool { return $this->item_type === 'boost'; } public function isMonthly(): bool { return $this->billing_cycle === 'monthly'; } public function isYearly(): bool { return $this->billing_cycle === 'yearly'; } public function isOneTime(): bool { return $this->billing_cycle === 'onetime'; } }