/**
  * Store a newly created resource in storage.
  *
  * @return Response
  */
 public function store(Request $request)
 {
     if ($request->file('image')) {
         if ($request->file('image')->isValid()) {
             $fileName = (int) round(microtime(true) * 1000);
             $fileName .= '.' . $request->file('image')->guessExtension();
             $path = public_path() . '/img/uploads/';
             $request->file('image')->move($path, $fileName);
             $image = $fileName;
         }
     } else {
         $image = null;
     }
     $latitude = $request->input('latitude');
     $longitude = $request->input('longitude');
     $city = $request->input('city');
     $state = $request->input('state');
     $country = $request->input('country');
     $city = City::findOrCreate(compact('city', 'state', 'country'))->id;
     $point = new Spatialpoint();
     $point->point = Spatialpoint::geom($latitude, $longitude);
     $point->species = $request->input('species');
     $point->comments = $request->input('comments');
     $point->type = $request->input('type');
     $point->address = $request->input('address');
     $point->image = $image;
     $point->user_id = Auth::user()->id;
     $point->city_id = $city;
     $point->save();
 }