service = $service; $this->userId = $UserId; } /** * @NoAdminRequired */ public function index() { return new DataResponse($this->service->findAll($this->userId)); } /** * @NoAdminRequired * * @param int $id */ public function show($id) { return $this->handleNotFound(function () use ($id) { return $this->service->find($id, $this->userId); }); } /** * @NoAdminRequired * * @param string $stationid */ public function create($stationid) { return $this->service->create($stationid, $this->userId); } /** * @NoAdminRequired * * @param int $id * @param string $stationid */ public function update($id, $stationid) { return $this->handleNotFound(function () use ($id, $stationid) { return $this->service->update($id, $stationid, $this->userId); }); } /** * @NoAdminRequired * * @param int $id */ public function destroy($id) { return $this->handleNotFound(function () use ($id) { return $this->service->delete($id, $this->userId); }); } }