station_favorite = StationFavorites::with('station') ->where('lcard_uuid',$lcard_id); return $this->station_favorite->get(); } public function store($station_id, $lcard_id) { $this->station_favorite = new StationFavorites; $this->station_favorite->station_id = $station_id; $this->station_favorite->lcard_id = $lcard_id; if($this->station_favorite->save()) return $this->station_favorite->sf_id; else return false; } public function delete($station_id, $lcard_id) { $this->station_favorite = StationFavorites::where('station_id',$station_id) ->where('lcard_id',$lcard_id); if($this->station_favorite->delete()) return true; else return false; } }