/** * Handle the event. * * @param PointWasViewed $event * @return void */ public function handle(PointWasViewed $event) { // try { dd($event); $hit = new \App\PointHit(); $hit->point_id = $point_id; if (!$hit->save()) { return $this->respondInternalError(); } return $hit; } catch (Exception $e) { return $this->respondWithError(); } }
public function update_point_hits_table($point_id) { try { $hit = new \App\PointHit(); $hit->point_id = $point_id; if (!$hit->save()) { return $this->respondInternalError(); } return $hit; } catch (Exception $e) { return $this->respondWithError(); } }