belongsTo(Order::class, 'order_id'); } public function addons() { return $this->hasMany(OrderAddon::class, 'order_item_id'); } public function getProductAttribute() { return match ($this->product_type) { 3 => Hosting::find($this->product_id), 4 => Vps::find($this->product_id), default => null, }; } public function os() { return $this->belongsTo(Os::class, 'os_id'); } }