'integer', 'buyable_id' => 'integer', 'buyable_type' => 'string', 'cantidad' => 'integer', 'precio_unitario' => 'decimal:2', 'discount_total' => 'decimal:2', 'tax_total' => 'decimal:2', 'total' => 'decimal:2', ]; } /** * @return BelongsTo */ public function purchase(): BelongsTo { return $this->belongsTo(Purchase::class, 'compra_id'); } /** * @return \Illuminate\Database\Eloquent\Relations\MorphTo */ public function buyable() { return $this->morphTo(); } }