@@ -1436,6 +1436,13 @@ public function whereDate($column, $operator, $value = null, $boolean = 'and')
1436
1436
$ value , $ operator , func_num_args () === 2
1437
1437
);
1438
1438
1439
+ // If the given operator is not found in the list of valid operators we will
1440
+ // assume that the developer is just short-cutting the '=' operators and
1441
+ // we will set the operators to '=' and set the values appropriately.
1442
+ if ($ this ->invalidOperator ($ operator )) {
1443
+ [$ value , $ operator ] = [$ operator , '= ' ];
1444
+ }
1445
+
1439
1446
$ value = $ this ->flattenValue ($ value );
1440
1447
1441
1448
if ($ value instanceof DateTimeInterface) {
@@ -1477,6 +1484,13 @@ public function whereTime($column, $operator, $value = null, $boolean = 'and')
1477
1484
$ value , $ operator , func_num_args () === 2
1478
1485
);
1479
1486
1487
+ // If the given operator is not found in the list of valid operators we will
1488
+ // assume that the developer is just short-cutting the '=' operators and
1489
+ // we will set the operators to '=' and set the values appropriately.
1490
+ if ($ this ->invalidOperator ($ operator )) {
1491
+ [$ value , $ operator ] = [$ operator , '= ' ];
1492
+ }
1493
+
1480
1494
$ value = $ this ->flattenValue ($ value );
1481
1495
1482
1496
if ($ value instanceof DateTimeInterface) {
@@ -1518,6 +1532,13 @@ public function whereDay($column, $operator, $value = null, $boolean = 'and')
1518
1532
$ value , $ operator , func_num_args () === 2
1519
1533
);
1520
1534
1535
+ // If the given operator is not found in the list of valid operators we will
1536
+ // assume that the developer is just short-cutting the '=' operators and
1537
+ // we will set the operators to '=' and set the values appropriately.
1538
+ if ($ this ->invalidOperator ($ operator )) {
1539
+ [$ value , $ operator ] = [$ operator , '= ' ];
1540
+ }
1541
+
1521
1542
$ value = $ this ->flattenValue ($ value );
1522
1543
1523
1544
if ($ value instanceof DateTimeInterface) {
@@ -1563,6 +1584,13 @@ public function whereMonth($column, $operator, $value = null, $boolean = 'and')
1563
1584
$ value , $ operator , func_num_args () === 2
1564
1585
);
1565
1586
1587
+ // If the given operator is not found in the list of valid operators we will
1588
+ // assume that the developer is just short-cutting the '=' operators and
1589
+ // we will set the operators to '=' and set the values appropriately.
1590
+ if ($ this ->invalidOperator ($ operator )) {
1591
+ [$ value , $ operator ] = [$ operator , '= ' ];
1592
+ }
1593
+
1566
1594
$ value = $ this ->flattenValue ($ value );
1567
1595
1568
1596
if ($ value instanceof DateTimeInterface) {
@@ -1608,6 +1636,13 @@ public function whereYear($column, $operator, $value = null, $boolean = 'and')
1608
1636
$ value , $ operator , func_num_args () === 2
1609
1637
);
1610
1638
1639
+ // If the given operator is not found in the list of valid operators we will
1640
+ // assume that the developer is just short-cutting the '=' operators and
1641
+ // we will set the operators to '=' and set the values appropriately.
1642
+ if ($ this ->invalidOperator ($ operator )) {
1643
+ [$ value , $ operator ] = [$ operator , '= ' ];
1644
+ }
1645
+
1611
1646
$ value = $ this ->flattenValue ($ value );
1612
1647
1613
1648
if ($ value instanceof DateTimeInterface) {
@@ -1974,6 +2009,13 @@ public function whereJsonLength($column, $operator, $value = null, $boolean = 'a
1974
2009
$ value , $ operator , func_num_args () === 2
1975
2010
);
1976
2011
2012
+ // If the given operator is not found in the list of valid operators we will
2013
+ // assume that the developer is just short-cutting the '=' operators and
2014
+ // we will set the operators to '=' and set the values appropriately.
2015
+ if ($ this ->invalidOperator ($ operator )) {
2016
+ [$ value , $ operator ] = [$ operator , '= ' ];
2017
+ }
2018
+
1977
2019
$ this ->wheres [] = compact ('type ' , 'column ' , 'operator ' , 'value ' , 'boolean ' );
1978
2020
1979
2021
if (! $ value instanceof ExpressionContract) {
0 commit comments