You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+13-2Lines changed: 13 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -158,7 +158,9 @@ After `addDistanceFrom()` is applied
158
158
}
159
159
```
160
160
161
-
A custom field name can be third parameter can be passed to the `addDistanceFrom()` method if the name has been registered in the `whitelisted-distance-from-field-names` array of the geoscope.php config file. The distance field will have a default name of `distance` and the units field will have a default name of `distance_units`**The `addDistanceFromField()` method is only available through the GeoScopeTrait. It is not available on the database builder**
161
+
A custom field name can be passed as the third argument to the `addDistanceFrom()` method if the name has been registered in the `whitelisted-distance-from-field-names` array of the geoscope.php config file. The distance field will have a default name of `distance` and the units field will have a default name of `distance_units`.
162
+
163
+
**The `addDistanceFromField()` method is only available through the GeoScopeTrait. It is not available on the database builder**
public function orderByDistanceFrom(float $lat, float $long, string $orderDirection = 'asc');
265
+
266
+
/**
267
+
* @param float $lat
268
+
* @param float $long
269
+
* @param string $fieldName
270
+
* @return mixed
271
+
* Should return query instance
272
+
*/
273
+
public function addDistanceFromField(float $lat, float $long, string $fieldName);
263
274
}
264
275
```
265
-
The Query Builder instance is available within your driver via the `$this->query` property.
276
+
The Query Builder instance is available within your driver via the `$this->query` property, any config options passed will be available via the `$this->config` property.
266
277
267
278
#### Registering Custom Scope Drivers
268
279
Custom scope drivers can be registered using the `registerDriverStrategy` method on the `ScopeDriverFactory` class.
0 commit comments