@@ -93,35 +93,38 @@ public function columnSearch()
93
93
{
94
94
$ columns = $ this ->request ->get ('columns ' , []);
95
95
for ($ i = 0 , $ c = count ($ columns ); $ i < $ c ; $ i ++) {
96
- if ($ this ->request ->isColumnSearchable ($ i )) {
97
- $ this ->isFilterApplied = true ;
96
+ $ column = $ this ->getColumnName ($ i );
98
97
99
- $ regex = $ this ->request ->isRegex ($ i );
100
- $ column = $ this -> getColumnName ( $ i ) ;
101
- $ keyword = $ this -> request -> columnKeyword ( $ i );
98
+ if (! $ this ->request ->isColumnSearchable ($ i ) || $ this -> isBlacklisted ( $ column )) {
99
+ continue ;
100
+ }
102
101
103
- $ this ->collection = $ this ->collection ->filter (
104
- function ($ row ) use ($ column , $ keyword , $ regex ) {
105
- $ data = $ this ->serialize ($ row );
102
+ $ this ->isFilterApplied = true ;
106
103
107
- $ value = Arr::get ($ data , $ column );
104
+ $ regex = $ this ->request ->isRegex ($ i );
105
+ $ keyword = $ this ->request ->columnKeyword ($ i );
108
106
109
- if ($ this ->config ->isCaseInsensitive ()) {
110
- if ($ regex ) {
111
- return preg_match ('/ ' . $ keyword . '/i ' , $ value ) == 1 ;
112
- }
107
+ $ this ->collection = $ this ->collection ->filter (
108
+ function ($ row ) use ($ column , $ keyword , $ regex ) {
109
+ $ data = $ this ->serialize ($ row );
113
110
114
- return strpos (Str::lower ($ value ), Str::lower ($ keyword )) !== false ;
115
- }
111
+ $ value = Arr::get ($ data , $ column );
116
112
113
+ if ($ this ->config ->isCaseInsensitive ()) {
117
114
if ($ regex ) {
118
- return preg_match ('/ ' . $ keyword . '/ ' , $ value ) == 1 ;
115
+ return preg_match ('/ ' . $ keyword . '/i ' , $ value ) == 1 ;
119
116
}
120
117
121
- return strpos ($ value, $ keyword ) !== false ;
118
+ return strpos (Str:: lower ( $ value), Str:: lower ( $ keyword) ) !== false ;
122
119
}
123
- );
124
- }
120
+
121
+ if ($ regex ) {
122
+ return preg_match ('/ ' . $ keyword . '/ ' , $ value ) == 1 ;
123
+ }
124
+
125
+ return strpos ($ value , $ keyword ) !== false ;
126
+ }
127
+ );
125
128
}
126
129
}
127
130
0 commit comments