chaturmasReviewRepository = $chaturmasReviewRepository; } /** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function index() { try { $response = $this->chaturmasReviewRepository->getChaturmasReviewList($request->all()); $this->updateStatusCode($response); return $this->respond($response); } catch (Exception $ex) { Log::error($ex); return $this->respondInternalError(trans('api.something_went_wrong')); } } /** * Store a newly created resource in storage. * * @param StoreChaturmasReviewRequest $request * @return \Illuminate\Http\Response */ public function store(StoreChaturmasReviewRequest $request, Chaturmas $chaturmas) { try { $response = $this->chaturmasReviewRepository->storeChaturmasReview($request->all(), $chaturmas); $this->updateStatusCode($response); $this->setStatusCode($response['status']); } catch (Exception $ex) { $response['message'] = $ex->getMessage(); $this->setStatusCode(Constant::CODE_403); } return $this->respond($response); } /** * Display the specified resource. * * @param \App\Models\ChaturmasReview $chaturmasReview * @return \Illuminate\Http\Response */ public function show(ChaturmasReview $chaturmasReview) { try { $response = $this->chaturmasReviewRepository->showChaturmasReview($chaturma); $this->updateStatusCode($response); $this->setStatusCode($response['status']); } catch (Exception $ex) { $response['error'] = $ex->getMessage(); $this->setStatusCode(Constant::CODE_403); } return $this->respond($response); } /** * Update the specified resource in storage. * * @param \Illuminate\Http\Request $request * @param \App\Models\ChaturmasReview $chaturmasReview * @return \Illuminate\Http\Response */ public function update(Request $request, ChaturmasReview $chaturmasReview) { try { $response = $this->chaturmasReviewRepository->updateChaturmasReview($request->all(), $chaturma); $this->updateStatusCode($response); $this->setStatusCode($response['status']); } catch (\Exception $ex) { $response['error'] = $ex->getMessage(); $this->setStatusCode(Constant::CODE_403); } return $this->respond($response); } /** * Remove the specified resource from storage. * * @param \App\Models\ChaturmasReview $chaturmasReview * @return \Illuminate\Http\Response */ public function destroy(ChaturmasReview $chaturmasReview) { // } }