@@ -82,7 +82,7 @@ public function update($models): void
82
82
$ models ->each ->pushSoftDeleteMetadata ();
83
83
}
84
84
85
- $ this ->typesense ->importDocuments ($ collection , $ models ->map (fn ($ m ) => $ m ->toSearchableArray ())
85
+ $ this ->typesense ->importDocuments ($ collection , $ models ->map (fn ($ m ) => $ m ->toSearchableArray ())
86
86
->toArray ());
87
87
}
88
88
@@ -104,10 +104,10 @@ public function delete($models): void
104
104
/**
105
105
* @param \Laravel\Scout\Builder $builder
106
106
*
107
- * @return mixed
108
107
* @throws \Typesense\Exceptions\TypesenseClientError
109
- *
110
108
* @throws \Http\Client\Exception
109
+ *
110
+ * @return mixed
111
111
*/
112
112
public function search (Builder $ builder ): mixed
113
113
{
@@ -119,10 +119,10 @@ public function search(Builder $builder): mixed
119
119
* @param int $perPage
120
120
* @param int $page
121
121
*
122
- * @return mixed
123
122
* @throws \Typesense\Exceptions\TypesenseClientError
124
- *
125
123
* @throws \Http\Client\Exception
124
+ *
125
+ * @return mixed
126
126
*/
127
127
public function paginate (Builder $ builder , $ perPage , $ page ): mixed
128
128
{
@@ -139,13 +139,13 @@ public function paginate(Builder $builder, $perPage, $page): mixed
139
139
private function buildSearchParams (Builder $ builder , int $ page , int $ perPage ): array
140
140
{
141
141
$ params = [
142
- 'q ' => $ builder ->query ,
143
- 'query_by ' => implode (', ' , $ builder ->model ->typesenseQueryBy ()),
144
- 'filter_by ' => $ this ->filters ($ builder ),
145
- 'per_page ' => $ perPage ,
146
- 'page ' => $ page ,
147
- 'highlight_start_tag ' => $ this ->startTag ,
148
- 'highlight_end_tag ' => $ this ->endTag ,
142
+ 'q ' => $ builder ->query ,
143
+ 'query_by ' => implode (', ' , $ builder ->model ->typesenseQueryBy ()),
144
+ 'filter_by ' => $ this ->filters ($ builder ),
145
+ 'per_page ' => $ perPage ,
146
+ 'page ' => $ page ,
147
+ 'highlight_start_tag ' => $ this ->startTag ,
148
+ 'highlight_end_tag ' => $ this ->endTag ,
149
149
];
150
150
151
151
if ($ this ->limitHits > 0 ) {
@@ -213,10 +213,10 @@ private function parseOrderBy(array $orders): string
213
213
* @param \Laravel\Scout\Builder $builder
214
214
* @param array $options
215
215
*
216
- * @return mixed
217
216
* @throws \Typesense\Exceptions\TypesenseClientError
218
- *
219
217
* @throws \Http\Client\Exception
218
+ *
219
+ * @return mixed
220
220
*/
221
221
protected function performSearch (Builder $ builder , array $ options = []): mixed
222
222
{
@@ -240,8 +240,8 @@ protected function filters(Builder $builder): string
240
240
{
241
241
return collect ($ builder ->wheres )
242
242
->map ([
243
- $ this ,
244
- 'parseFilters ' ,
243
+ $ this ,
244
+ 'parseFilters ' ,
245
245
])
246
246
->values ()
247
247
->implode (' && ' );
@@ -311,7 +311,7 @@ public function map(Builder $builder, $results, $model): \Illuminate\Database\El
311
311
*/
312
312
public function getTotalCount ($ results ): int
313
313
{
314
- return (int )($ results ['found ' ] ?? 0 );
314
+ return (int ) ($ results ['found ' ] ?? 0 );
315
315
}
316
316
317
317
/**
@@ -345,7 +345,7 @@ protected function usesSoftDelete($model): bool
345
345
*/
346
346
public function lazyMap (Builder $ builder , $ results , $ model ): LazyCollection
347
347
{
348
- if ((int )($ results ['found ' ] ?? 0 ) === 0 ) {
348
+ if ((int ) ($ results ['found ' ] ?? 0 ) === 0 ) {
349
349
return LazyCollection::make ($ model ->newCollection ());
350
350
}
351
351
@@ -371,9 +371,9 @@ public function lazyMap(Builder $builder, $results, $model): LazyCollection
371
371
* @param string $name
372
372
* @param array $options
373
373
*
374
- * @return void
375
374
* @throws \Exception
376
375
*
376
+ * @return void
377
377
*/
378
378
public function createIndex ($ name , array $ options = []): void
379
379
{
@@ -465,10 +465,10 @@ public function limitHits(int $limitHits): static
465
465
public function orderByLocation (string $ column , float $ lat , float $ lng , string $ direction ): static
466
466
{
467
467
$ this ->locationOrderBy = [
468
- 'column ' => $ column ,
469
- 'lat ' => $ lat ,
470
- 'lng ' => $ lng ,
471
- 'direction ' => $ direction ,
468
+ 'column ' => $ column ,
469
+ 'lat ' => $ lat ,
470
+ 'lng ' => $ lng ,
471
+ 'direction ' => $ direction ,
472
472
];
473
473
474
474
return $ this ;
@@ -477,11 +477,11 @@ public function orderByLocation(string $column, float $lat, float $lng, string $
477
477
/**
478
478
* @param string $name
479
479
*
480
- * @return array
481
480
* @throws \Typesense\Exceptions\ObjectNotFound
482
481
* @throws \Typesense\Exceptions\TypesenseClientError
483
- *
484
482
* @throws \Http\Client\Exception
483
+ *
484
+ * @return array
485
485
*/
486
486
public function deleteIndex ($ name ): array
487
487
{
0 commit comments