Commit 7b7c8b1 authored Apr 5, 2024 Verified
1 parent dc889d1 commit 7b7c8b1 Copy full SHA for 7b7c8b1
File tree 1 file changed +7
-5
lines changed
1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -161,11 +161,13 @@ Each transformer is a closure that would correspond to a field in your index's `
161
161
162
162
// Return an array of values to be stored.
163
163
// These will all be separate searchable fields in the index.
164
- 'address' => function ($address) {
164
+ // $value is the current value
165
+ // $searchable is the object that $value has been plucked from
166
+ 'address' => function ($value, $searchable) {
165
167
return [
166
- '_geoloc' => $address ['geolocation'],
167
- 'location' => $address ['location'],
168
- 'region' => $address ['region'],
168
+ '_geoloc' => $value ['geolocation'],
169
+ 'location' => $value ['location'],
170
+ 'region' => $value ['region'],
169
171
];
170
172
}
171
173
]
@@ -189,7 +191,7 @@ class MyTransformer
189
191
{
190
192
// $value is the current value
191
193
// $field is the index from the transformers array
192
- // $searchable is the class that $value has been plucked from
194
+ // $searchable is the object that $value has been plucked from
193
195
194
196
return ucfirst($value);
195
197
}
You can’t perform that action at this time.
0 commit comments