Ejemplo n.º 1
0
 public function near($place = null)
 {
     $this->_render['template'] = 'index';
     $coords = Geocoder::find('google', $place);
     $photos = Photo::within(array($coords, $coords), array('limit' => 1));
     return compact('photos');
 }
Ejemplo n.º 2
0
 public function save($entity, $data = null, array $options = array())
 {
     if ($data) {
         $entity->set($data);
     }
     if (!$entity->exists() && isset($entity->file->tmp_name)) {
         $entity->location = Geocoder::exifCoords(exif_read_data($entity->file->tmp_name));
     }
     if ($entity->tags && !is_array($entity->tags)) {
         $entity->tags = array_map('trim', explode(',', $entity->tags));
     }
     return parent::save($entity, null, $options);
 }