File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -115,15 +115,15 @@ public function models(): Builder
115
115
foreach ($ this ->columns () as $ column ) {
116
116
if ($ column ->searchable ) {
117
117
if (is_callable ($ column ->searchCallback )) {
118
- $ builder = app ()->call ($ column ->searchCallback , ['builder ' => $ builder , 'term ' => $ this ->search ]);
118
+ $ builder = app ()->call ($ column ->searchCallback , ['builder ' => $ builder , 'term ' => trim ( $ this ->search ) ]);
119
119
} elseif (Str::contains ($ column ->attribute , '. ' )) {
120
120
$ relationship = $ this ->relationship ($ column ->attribute );
121
121
122
122
$ builder ->orWhereHas ($ relationship ->name , function (Builder $ builder ) use ($ relationship ) {
123
- $ builder ->where ($ relationship ->attribute , 'like ' , '% ' .$ this ->search .'% ' );
123
+ $ builder ->where ($ relationship ->attribute , 'like ' , '% ' .trim ( $ this ->search ) .'% ' );
124
124
});
125
125
} else {
126
- $ builder ->orWhere ($ builder ->getModel ()->getTable ().'. ' .$ column ->attribute , 'like ' , '% ' .$ this ->search .'% ' );
126
+ $ builder ->orWhere ($ builder ->getModel ()->getTable ().'. ' .$ column ->attribute , 'like ' , '% ' .trim ( $ this ->search ) .'% ' );
127
127
}
128
128
}
129
129
}
You can’t perform that action at this time.
0 commit comments