@@ -40,7 +40,7 @@ protected function setAdditionalReservedFilters(...$filterNames)
4040 array_push ($ this ->reservedFilters , ...$ filterNames );
4141 }
4242
43- public function paginate (): LengthAwarePaginator
43+ protected function paginate (): LengthAwarePaginator
4444 {
4545 $ defaultPerPage = config ('defaults.items_per_page ' );
4646 $ perPage = Arr::get ($ this ->filter , 'per_page ' , $ defaultPerPage );
@@ -138,10 +138,10 @@ public function searchQuery(array $filter = []): self
138138 $ this ->filterLess ($ field , true , $ fieldName );
139139 } elseif (Str::endsWith ($ fieldName , '_from ' )) {
140140 $ field = Str::replace ('_from ' , '' , $ fieldName );
141- $ this ->filterFrom ($ field , false , $ fieldName );
141+ $ this ->filterGreater ($ field , false , $ fieldName );
142142 } elseif (Str::endsWith ($ fieldName , '_to ' )) {
143143 $ field = Str::replace ('_to ' , '' , $ fieldName );
144- $ this ->filterTo ($ field , false , $ fieldName );
144+ $ this ->filterLess ($ field , false , $ fieldName );
145145 } elseif (Str::endsWith ($ fieldName , '_in_list ' )) {
146146 $ field = Str::replace ('_in_list ' , '' , $ fieldName );
147147 $ this ->filterByList ($ field , $ fieldName );
@@ -169,7 +169,7 @@ public function getSearchResults(): LengthAwarePaginator
169169 return $ this ->wrapPaginatedData ($ data );
170170 }
171171
172- public function wrapPaginatedData (Collection $ data ): LengthAwarePaginator
172+ protected function wrapPaginatedData (Collection $ data ): LengthAwarePaginator
173173 {
174174 $ total = $ data ->count ();
175175
@@ -183,7 +183,7 @@ public function wrapPaginatedData(Collection $data): LengthAwarePaginator
183183 return $ this ->getModifiedPaginator ($ paginator );
184184 }
185185
186- public function getModifiedPaginator (LengthAwarePaginator $ paginator ): LengthAwarePaginator
186+ protected function getModifiedPaginator (LengthAwarePaginator $ paginator ): LengthAwarePaginator
187187 {
188188 $ collection = $ paginator ->getCollection ();
189189
@@ -215,30 +215,6 @@ protected function getDesc(bool $isDesc): string
215215 return ($ isDesc ) ? 'DESC ' : 'ASC ' ;
216216 }
217217
218- /** @deprecated use filterGreater instead */
219- public function filterMoreThan (string $ field , $ value ): self
220- {
221- return $ this ->filterValue ($ field , '> ' , $ value );
222- }
223-
224- /** @deprecated use filterLess instead */
225- public function filterLessThan (string $ field , $ value ): self
226- {
227- return $ this ->filterValue ($ field , '< ' , $ value );
228- }
229-
230- /** @deprecated use filterGreater instead */
231- public function filterMoreOrEqualThan (string $ field , $ value ): self
232- {
233- return $ this ->filterValue ($ field , '>= ' , $ value );
234- }
235-
236- /** @deprecated use filterLess instead */
237- public function filterLessOrEqualThan (string $ field , $ value ): self
238- {
239- return $ this ->filterValue ($ field , '<= ' , $ value );
240- }
241-
242218 public function filterValue (string $ field , string $ sign , $ value ): self
243219 {
244220 if (!empty ($ value )) {
@@ -290,12 +266,6 @@ protected function getQuerySearchCallback(string $field, string $mask): Closure
290266 };
291267 }
292268
293- /** @deprecated use filterGreater instead */
294- public function filterFrom (string $ field , bool $ isStrict = true , ?string $ filterName = null ): self
295- {
296- return $ this ->filterGreater ($ field , $ isStrict , $ filterName );
297- }
298-
299269 public function filterGreater (string $ field , bool $ isStrict = true , ?string $ filterName = null ): self
300270 {
301271 $ filterName = empty ($ filterName ) ? 'from ' : $ filterName ;
@@ -308,12 +278,6 @@ public function filterGreater(string $field, bool $isStrict = true, ?string $fil
308278 return $ this ;
309279 }
310280
311- /** @deprecated use filterLess instead */
312- public function filterTo (string $ field , bool $ isStrict = true , ?string $ filterName = null ): self
313- {
314- return $ this ->filterLess ($ field , $ isStrict , $ filterName );
315- }
316-
317281 public function filterLess (string $ field , bool $ isStrict = true , ?string $ filterName = null ): self
318282 {
319283 $ filterName = (empty ($ filterName )) ? 'to ' : $ filterName ;
0 commit comments