@@ -31,15 +31,15 @@ public function prepareMatchFields(RestifyRequest $request, $query, $extra = [])
3131 foreach ($ this ->repository ->getMatchByFields () as $ key => $ type ) {
3232 $ negation = false ;
3333
34- if ($ request ->has ('- ' . $ key )) {
34+ if ($ request ->has ('- ' . $ key )) {
3535 $ negation = true ;
3636 }
3737
38- if (!$ request ->has ($ negation ? '- ' . $ key : $ key ) && !data_get ($ extra , "match. $ key " )) {
38+ if (! $ request ->has ($ negation ? '- ' . $ key : $ key ) && ! data_get ($ extra , "match. $ key " )) {
3939 continue ;
4040 }
4141
42- $ match = $ request ->input ($ negation ? '- ' . $ key : $ key , data_get ($ extra , "match. $ key " ));
42+ $ match = $ request ->input ($ negation ? '- ' . $ key : $ key , data_get ($ extra , "match. $ key " ));
4343
4444 if ($ negation ) {
4545 $ key = Str::after ($ key , '- ' );
@@ -76,7 +76,7 @@ public function prepareMatchFields(RestifyRequest $request, $query, $extra = [])
7676 case RestifySearchable::MATCH_INTEGER :
7777 case 'number ' :
7878 case 'int ' :
79- $ query ->where ($ field , $ negation ? '!= ' : '= ' , (int )$ match );
79+ $ query ->where ($ field , $ negation ? '!= ' : '= ' , (int ) $ match );
8080 break ;
8181 case RestifySearchable::MATCH_DATETIME :
8282 $ query ->whereDate ($ field , $ negation ? '!= ' : '= ' , $ match );
@@ -114,7 +114,7 @@ public function prepareOrders(RestifyRequest $request, $query, $extra = [])
114114 }
115115
116116 if (empty ($ params ) === true ) {
117- $ this ->setOrder ($ query , '+ ' . $ this ->repository ->newModel ()->getKeyName ());
117+ $ this ->setOrder ($ query , '+ ' . $ this ->repository ->newModel ()->getKeyName ());
118118 }
119119
120120 return $ query ;
@@ -158,7 +158,7 @@ public function prepareSearchFields(RestifyRequest $request, $query, $extra = []
158158 $ likeOperator = $ connectionType == 'pgsql ' ? 'ilike ' : 'like ' ;
159159
160160 foreach ($ this ->repository ->getSearchableFields () as $ column ) {
161- $ query ->orWhere ($ model ->qualifyColumn ($ column ), $ likeOperator , '% ' . $ search . '% ' );
161+ $ query ->orWhere ($ model ->qualifyColumn ($ column ), $ likeOperator , '% ' . $ search. '% ' );
162162 }
163163 });
164164
@@ -211,12 +211,12 @@ public function setOrder($query, $param)
211211
212212 protected function applyIndexQuery (RestifyRequest $ request , Repository $ repository )
213213 {
214- return fn ($ query ) => $ repository ::indexQuery ($ request , $ query ->with ($ repository ::$ with ));
214+ return fn ($ query ) => $ repository ::indexQuery ($ request , $ query ->with ($ repository ::$ with ));
215215 }
216216
217217 protected function applyFilters (RestifyRequest $ request , Repository $ repository , $ query )
218218 {
219- if (!empty ($ request ->filters )) {
219+ if (! empty ($ request ->filters )) {
220220 $ filters = json_decode (base64_decode ($ request ->filters ), true );
221221
222222 collect ($ filters )
@@ -242,7 +242,7 @@ protected function applyFilters(RestifyRequest $request, Repository $repository,
242242 return $ matchingFilter ;
243243 })
244244 ->filter ()
245- ->each (fn (Filter $ filter ) => $ filter ->filter ($ request , $ query , $ filter ->value ));
245+ ->each (fn (Filter $ filter ) => $ filter ->filter ($ request , $ query , $ filter ->value ));
246246 }
247247
248248 return $ query ;
0 commit comments