Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if ((isset($resultObject->status) && $resultObject->status == self::GOOGLE_RESPONSE_ZERO_RESULTS) ||
- !isset($resultObject->results) ||
- (isset($resultObject->results) && count($resultObject->results) == 0)
- ) {
- throw new MapperSearchResultException('No results found for the location search.');
- }
- if (!isset($resultObject->results[0]->formatted_address) ||
- !isset($resultObject->results[0]->address_components[0]->types[0]) ||
- !isset($resultObject->results[0]->geometry->location->lat) ||
- !isset($resultObject->results[0]->geometry->location->lng) ||
- !isset($resultObject->results[0]->place_id) ||
- isset($resultObject->status) && $resultObject->status != self::GOOGLE_RESPONSE_OK
- ) {
- throw new MapperException('The location search return invalid result data.');
- }
- mam kontroler i metodę gdzie iteruje po elementach:
- if($user->connected_to_gyms){
- foreach($user->connected_to_gyms as $key =>$man){
- Mapper::location("$man->city $man->street $man->local")->map(['zoom' => 15, 'center' => true, 'marker' => true, 'type' => 'roadmap']);
- }
- }
- i widok:
- @foreach($user->connected_to_gyms as $key =>$man)
- <div class="col-xs-12 col-md-3 text-center" style="height: 200px;">
- {!! Mapper::render ($key) !!}
- </div>
- @endforeach
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement