| @@ 114-126 (lines=13) @@ | ||
| 111 | return $this->aggregator->getName(); |
|
| 112 | } |
|
| 113 | ||
| 114 | public function geocode(string $value) : self |
|
| 115 | { |
|
| 116 | $cacheKey = str_slug(strtolower(urlencode($value))); |
|
| 117 | $this->results = app('cache')->remember( |
|
| 118 | "geocoder-{$cacheKey}", |
|
| 119 | config('geocoder.cache-duraction', 0), |
|
| 120 | function () use ($value) { |
|
| 121 | return collect($this->aggregator->geocode($value)); |
|
| 122 | } |
|
| 123 | ); |
|
| 124 | ||
| 125 | return $this; |
|
| 126 | } |
|
| 127 | ||
| 128 | public function reverse(float $latitude, float $longitude) : self |
|
| 129 | { |
|
| @@ 128-140 (lines=13) @@ | ||
| 125 | return $this; |
|
| 126 | } |
|
| 127 | ||
| 128 | public function reverse(float $latitude, float $longitude) : self |
|
| 129 | { |
|
| 130 | $cacheKey = str_slug(strtolower(urlencode("{$latitude}-{$longitude}"))); |
|
| 131 | $this->results = app('cache')->remember( |
|
| 132 | "geocoder-{$cacheKey}", |
|
| 133 | config('geocoder.cache-duraction', 0), |
|
| 134 | function () use ($latitude, $longitude) { |
|
| 135 | return collect($this->aggregator->reverse($latitude, $longitude)); |
|
| 136 | } |
|
| 137 | ); |
|
| 138 | ||
| 139 | return $this; |
|
| 140 | } |
|
| 141 | ||
| 142 | public function limit(int $limit) : self |
|
| 143 | { |
|