Skip to content

Commit 0201e2f

Browse files
author
Adam Hutchison
committed
Updates the readme
1 parent ede363a commit 0201e2f

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

README.md

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,9 @@ After `addDistanceFrom()` is applied
158158
}
159159
```
160160

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**
162164

163165
```php
164166
'whitelisted-distance-from-field-names' => [
@@ -260,9 +262,18 @@ interface ScopeDriverInterface
260262
* Should return query instance
261263
*/
262264
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);
263274
}
264275
```
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.
266277

267278
#### Registering Custom Scope Drivers
268279
Custom scope drivers can be registered using the `registerDriverStrategy` method on the `ScopeDriverFactory` class.

0 commit comments

Comments
 (0)