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()]; } }
/** * Display the specified resource. * * @param int $id * @return \Illuminate\Http\Response */ public function show($id) { return $this->repository->find($id); }