public function update(array $data, $id) { try { $this->validator->with($data)->passesOrFail(); return $this->repository->update($data, $id); } catch (ValidatorException $e) { return ['error' => true, 'message' => $e->getMessageBag()]; } }
/** * Remove the specified resource from storage. * * @param int $id * @return Response */ public function destroy($id) { if ($this->repository->find($id)->delete()) { return ["success" => true]; } return ["success" => false]; }
public function update(array $data, $id) { return $this->repository->update($data, $id); }
/** * Remove the specified resource from storage. * * @param int $id * @return \Illuminate\Http\Response */ public function destroy($id) { $this->repository->delete($id); }