paper = new Paper(); } /** * get:/airly_all * @return \Illuminate\Http\RedirectResponse */ public function airly_all() { $airly = new Airly(); $this->paper->sendImagePrint($airly->icon); $this->paper->sendHeaderPrint('Jakość powietrza:' . PHP_EOL . date('H:i d-m-Y')); $airly->setStations(config('paper.airly.stations')); foreach ($airly->getStations() as $stationId) { $stationInfo = $airly->getStationInfo($stationId); $this->paper->sendHeaderPrint($stationInfo['address']['locality'] . ' ' . $stationInfo['address']['route']); $dataText = $airly->getInformationText($stationId); $this->paper->sendPrint('', $dataText); } return back(); } public function airly_rzeczypospolitej() { $airly = new Airly(); $this->paper->sendImagePrint($airly->icon); $this->paper->sendHeaderPrint('Jakość powietrza:' . PHP_EOL . date('H:i d-m-Y')); $airly->setStations([config('paper.airly.rzeczypospolitej')]); foreach ($airly->getStations() as $stationId) { $stationInfo = $airly->getStationInfo($stationId); $this->paper->sendHeaderPrint($stationInfo['address']['locality'] . ' ' . $stationInfo['address']['route']); $dataText = $airly->getInformationText($stationId); $this->paper->sendPrint('', $dataText); } return back(); } public function airly_grunwaldzka() { $airly = new Airly(); $this->paper->sendImagePrint($airly->icon); $this->paper->sendHeaderPrint('Jakość powietrza:' . PHP_EOL . date('H:i d-m-Y')); $airly->setStations([config('paper.airly.grunwaldzka')]); foreach ($airly->getStations() as $stationId) { $stationInfo = $airly->getStationInfo($stationId); $this->paper->sendHeaderPrint($stationInfo['address']['locality'] . ' ' . $stationInfo['address']['route']); $dataText = $airly->getInformationText($stationId); $this->paper->sendPrint('', $dataText); } return back(); } public function airly_sowinskiego() { $airly = new Airly(); $this->paper->sendImagePrint($airly->icon); $this->paper->sendHeaderPrint('Jakość powietrza:' . PHP_EOL . date('H:i d-m-Y')); $airly->setStations([config('paper.airly.sowinskiego')]); foreach ($airly->getStations() as $stationId) { $stationInfo = $airly->getStationInfo($stationId); $this->paper->sendHeaderPrint($stationInfo['address']['locality'] . ' ' . $stationInfo['address']['route']); $dataText = $airly->getInformationText($stationId); $this->paper->sendPrint('', $dataText); } return back(); } }