@@ 88-100 (lines=13) @@ | ||
85 | return $this->aggregator->getName(); |
|
86 | } |
|
87 | ||
88 | public function geocode(string $value) : self |
|
89 | { |
|
90 | $cacheId = str_slug($value); |
|
91 | $this->results = cache()->remember( |
|
92 | "geocoder-{$cacheId}", |
|
93 | config('geocoder.cache-duraction', 0), |
|
94 | function () use ($value) { |
|
95 | return $this->aggregator->geocode($value); |
|
96 | } |
|
97 | ); |
|
98 | ||
99 | return $this; |
|
100 | } |
|
101 | ||
102 | public function reverse(float $latitude, float $longitude) : self |
|
103 | { |
|
@@ 102-114 (lines=13) @@ | ||
99 | return $this; |
|
100 | } |
|
101 | ||
102 | public function reverse(float $latitude, float $longitude) : self |
|
103 | { |
|
104 | $cacheId = str_slug("{$latitude}-{$longitude}"); |
|
105 | $this->results = cache()->remember( |
|
106 | "geocoder-{$cacheId}", |
|
107 | config('geocoder.cache-duraction', 0), |
|
108 | function () use ($latitude, $longitude) { |
|
109 | return $this->aggregator->reverse($latitude, $longitude); |
|
110 | } |
|
111 | ); |
|
112 | ||
113 | return $this; |
|
114 | } |
|
115 | ||
116 | public function limit($limit) |
|
117 | { |