@@ -1517,6 +1517,13 @@ public function whereDate($column, $operator, $value = null, $boolean = 'and')
1517
1517
$ value , $ operator , func_num_args () === 2
1518
1518
);
1519
1519
1520
+ // If the given operator is not found in the list of valid operators we will
1521
+ // assume that the developer is just short-cutting the '=' operators and
1522
+ // we will set the operators to '=' and set the values appropriately.
1523
+ if ($ this ->invalidOperator ($ operator )) {
1524
+ [$ value , $ operator ] = [$ operator , '= ' ];
1525
+ }
1526
+
1520
1527
$ value = $ this ->flattenValue ($ value );
1521
1528
1522
1529
if ($ value instanceof DateTimeInterface) {
@@ -1558,6 +1565,13 @@ public function whereTime($column, $operator, $value = null, $boolean = 'and')
1558
1565
$ value , $ operator , func_num_args () === 2
1559
1566
);
1560
1567
1568
+ // If the given operator is not found in the list of valid operators we will
1569
+ // assume that the developer is just short-cutting the '=' operators and
1570
+ // we will set the operators to '=' and set the values appropriately.
1571
+ if ($ this ->invalidOperator ($ operator )) {
1572
+ [$ value , $ operator ] = [$ operator , '= ' ];
1573
+ }
1574
+
1561
1575
$ value = $ this ->flattenValue ($ value );
1562
1576
1563
1577
if ($ value instanceof DateTimeInterface) {
@@ -1599,6 +1613,13 @@ public function whereDay($column, $operator, $value = null, $boolean = 'and')
1599
1613
$ value , $ operator , func_num_args () === 2
1600
1614
);
1601
1615
1616
+ // If the given operator is not found in the list of valid operators we will
1617
+ // assume that the developer is just short-cutting the '=' operators and
1618
+ // we will set the operators to '=' and set the values appropriately.
1619
+ if ($ this ->invalidOperator ($ operator )) {
1620
+ [$ value , $ operator ] = [$ operator , '= ' ];
1621
+ }
1622
+
1602
1623
$ value = $ this ->flattenValue ($ value );
1603
1624
1604
1625
if ($ value instanceof DateTimeInterface) {
@@ -1644,6 +1665,13 @@ public function whereMonth($column, $operator, $value = null, $boolean = 'and')
1644
1665
$ value , $ operator , func_num_args () === 2
1645
1666
);
1646
1667
1668
+ // If the given operator is not found in the list of valid operators we will
1669
+ // assume that the developer is just short-cutting the '=' operators and
1670
+ // we will set the operators to '=' and set the values appropriately.
1671
+ if ($ this ->invalidOperator ($ operator )) {
1672
+ [$ value , $ operator ] = [$ operator , '= ' ];
1673
+ }
1674
+
1647
1675
$ value = $ this ->flattenValue ($ value );
1648
1676
1649
1677
if ($ value instanceof DateTimeInterface) {
@@ -1689,6 +1717,13 @@ public function whereYear($column, $operator, $value = null, $boolean = 'and')
1689
1717
$ value , $ operator , func_num_args () === 2
1690
1718
);
1691
1719
1720
+ // If the given operator is not found in the list of valid operators we will
1721
+ // assume that the developer is just short-cutting the '=' operators and
1722
+ // we will set the operators to '=' and set the values appropriately.
1723
+ if ($ this ->invalidOperator ($ operator )) {
1724
+ [$ value , $ operator ] = [$ operator , '= ' ];
1725
+ }
1726
+
1692
1727
$ value = $ this ->flattenValue ($ value );
1693
1728
1694
1729
if ($ value instanceof DateTimeInterface) {
@@ -2114,6 +2149,13 @@ public function whereJsonLength($column, $operator, $value = null, $boolean = 'a
2114
2149
$ value , $ operator , func_num_args () === 2
2115
2150
);
2116
2151
2152
+ // If the given operator is not found in the list of valid operators we will
2153
+ // assume that the developer is just short-cutting the '=' operators and
2154
+ // we will set the operators to '=' and set the values appropriately.
2155
+ if ($ this ->invalidOperator ($ operator )) {
2156
+ [$ value , $ operator ] = [$ operator , '= ' ];
2157
+ }
2158
+
2117
2159
$ this ->wheres [] = compact ('type ' , 'column ' , 'operator ' , 'value ' , 'boolean ' );
2118
2160
2119
2161
if (! $ value instanceof ExpressionContract) {
0 commit comments