@@ -727,7 +727,7 @@ protected function addCustomCrudFilters()
727
727
],
728
728
false , // the simple filter has no values, just the "Draft" label specified above
729
729
function () { // if the filter is active (the GET parameter "draft" exits)
730
- $ this ->crud ->addClause ('where ' , 'checkbox ' , '1 ' );
730
+ $ this ->crud ->addClause ('where ' , 'checkbox ' , '1 ' );
731
731
}
732
732
);
733
733
@@ -748,7 +748,7 @@ function () { // if the filter is active (the GET parameter "draft" exits)
748
748
],
749
749
false ,
750
750
function ($ value ) { // if the filter is active
751
- $ this ->crud ->addClause ('where ' , 'text ' , 'LIKE ' , "% $ value% " );
751
+ $ this ->crud ->addClause ('where ' , 'text ' , 'LIKE ' , "% $ value% " );
752
752
}
753
753
);
754
754
@@ -762,7 +762,7 @@ function ($value) { // if the filter is active
762
762
],
763
763
false ,
764
764
function ($ value ) { // if the filter is active
765
- $ range = json_decode ($ value );
765
+ $ range = json_decode ($ value );
766
766
if ($ range ->from && $ range ->to ) {
767
767
$ this ->crud ->addClause ('where ' , 'number ' , '>= ' , (float ) $ range ->from );
768
768
$ this ->crud ->addClause ('where ' , 'number ' , '<= ' , (float ) $ range ->to );
@@ -778,7 +778,7 @@ function ($value) { // if the filter is active
778
778
],
779
779
false ,
780
780
function ($ value ) { // if the filter is active, apply these constraints
781
- $ this ->crud ->addClause ('where ' , 'date ' , '= ' , $ value );
781
+ $ this ->crud ->addClause ('where ' , 'date ' , '= ' , $ value );
782
782
}
783
783
);
784
784
@@ -796,7 +796,7 @@ function ($value) { // if the filter is active, apply these constraints
796
796
],
797
797
false ,
798
798
function ($ value ) { // if the filter is active, apply these constraints
799
- $ dates = json_decode ($ value );
799
+ $ dates = json_decode ($ value );
800
800
$ this ->crud ->addClause ('where ' , 'date ' , '>= ' , $ dates ->from );
801
801
$ this ->crud ->addClause ('where ' , 'date ' , '<= ' , $ dates ->to );
802
802
}
@@ -809,7 +809,7 @@ function ($value) { // if the filter is active, apply these constraints
809
809
], function () {
810
810
return \Backpack \NewsCRUD \app \Models \Category::all ()->keyBy ('id ' )->pluck ('name ' , 'id ' )->toArray ();
811
811
}, function ($ value ) { // if the filter is active
812
- $ this ->crud ->addClause ('where ' , 'select2 ' , $ value );
812
+ $ this ->crud ->addClause ('where ' , 'select2 ' , $ value );
813
813
});
814
814
815
815
$ this ->crud ->addFilter ([ // select2_multiple filter
@@ -819,9 +819,9 @@ function ($value) { // if the filter is active, apply these constraints
819
819
], function () {
820
820
return \Backpack \NewsCRUD \app \Models \Category::all ()->keyBy ('id ' )->pluck ('name ' , 'id ' )->toArray ();
821
821
}, function ($ values ) { // if the filter is active
822
- foreach (json_decode ($ values ) as $ key => $ value ) {
823
- $ this ->crud ->addClause ('orWhere ' , 'select2 ' , $ value );
824
- }
822
+ foreach (json_decode ($ values ) as $ key => $ value ) {
823
+ $ this ->crud ->addClause ('orWhere ' , 'select2 ' , $ value );
824
+ }
825
825
});
826
826
827
827
$ this ->crud ->addFilter (
@@ -834,7 +834,7 @@ function ($value) { // if the filter is active, apply these constraints
834
834
],
835
835
url ('api/article-search ' ), // the ajax route
836
836
function ($ value ) { // if the filter is active
837
- $ this ->crud ->addClause ('where ' , 'select2_from_ajax ' , $ value );
837
+ $ this ->crud ->addClause ('where ' , 'select2_from_ajax ' , $ value );
838
838
}
839
839
);
840
840
}
0 commit comments