public function push($lat, $long, $user_id) { $arr = null; try { $location = new Location(); $location->latitude = $lat; $location->longitude = $long; $location->date = Util::dateTimeNow(); $location->user_id = $user_id; $location->save(); $arr = ['status' => 'OK']; } catch (\Exception $e) { $arr = ['status' => 'ERROR']; Log::error('ERROR: ' . $e->getmessage()); } return json_encode($arr); }