db ->table($this->table . " t1") ->select( "t1.id AS id, t1.factura_id AS factura_id, t1.notes AS notes, t1.fecha_pago_at AS fecha_pago_at, t1.fecha_vencimiento_at AS fecha_vencimiento_at, t1.forma_pago_id AS forma_pago_id, t2.nombre as forma_pago, t1.total AS total" ) ->join("formas_pago t2", "t2.id = t1.forma_pago_id", "left") ->where("t1.factura_id", $factura_id) ->where("t1.deleted_at", null); return $builder; } }