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