@@ -1717,6 +1717,26 @@ public function orHaving($column, $operator = null, $value = null)
17171717 return $ this ->having ($ column , $ operator , $ value , 'or ' );
17181718 }
17191719
1720+ /**
1721+ * Add a "having between " clause to the query.
1722+ *
1723+ * @param string $column
1724+ * @param array $values
1725+ * @param string $boolean
1726+ * @param bool $not
1727+ * @return \Illuminate\Database\Query\Builder|static
1728+ */
1729+ public function havingBetween ($ column , array $ values , $ boolean = 'and ' , $ not = false )
1730+ {
1731+ $ type = 'between ' ;
1732+
1733+ $ this ->havings [] = compact ('type ' , 'column ' , 'values ' , 'boolean ' , 'not ' );
1734+
1735+ $ this ->addBinding ($ this ->cleanBindings ($ values ), 'having ' );
1736+
1737+ return $ this ;
1738+ }
1739+
17201740 /**
17211741 * Add a raw having clause to the query.
17221742 *
@@ -2575,7 +2595,7 @@ public function insert(array $values)
25752595 /**
25762596 * Insert a new record and get the value of the primary key.
25772597 *
2578- * @param array $values
2598+ * @param array $values
25792599 * @param string|null $sequence
25802600 * @return int
25812601 */
@@ -2588,6 +2608,23 @@ public function insertGetId(array $values, $sequence = null)
25882608 return $ this ->processor ->processInsertGetId ($ this , $ sql , $ values , $ sequence );
25892609 }
25902610
2611+ /**
2612+ * Insert new records into the table using a subquery.
2613+ *
2614+ * @param array $columns
2615+ * @param \Closure|\Illuminate\Database\Query\Builder|string $query
2616+ * @return bool
2617+ */
2618+ public function insertUsing (array $ columns , $ query )
2619+ {
2620+ [$ sql , $ bindings ] = $ this ->createSub ($ query );
2621+
2622+ return $ this ->connection ->insert (
2623+ $ this ->grammar ->compileInsertUsing ($ this , $ columns , $ sql ),
2624+ $ this ->cleanBindings ($ bindings )
2625+ );
2626+ }
2627+
25912628 /**
25922629 * Update a record in the database.
25932630 *
@@ -2624,7 +2661,7 @@ public function updateOrInsert(array $attributes, array $values = [])
26242661 *
26252662 * @param string $column
26262663 * @param float|int $amount
2627- * @param array $extra
2664+ * @param array $extra
26282665 * @return int
26292666 */
26302667 public function increment ($ column , $ amount = 1 , array $ extra = [])
@@ -2645,7 +2682,7 @@ public function increment($column, $amount = 1, array $extra = [])
26452682 *
26462683 * @param string $column
26472684 * @param float|int $amount
2648- * @param array $extra
2685+ * @param array $extra
26492686 * @return int
26502687 */
26512688 public function decrement ($ column , $ amount = 1 , array $ extra = [])
0 commit comments