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