modules = $this->modules(config('larayellow.review.modules'), 'review', guard_url('review')); $this->repository = $review; } /** * Show review's list. * * @return response */ protected function index(PublicRequest $request) { $search = $request->search; $pageLimit = $request->input('pageLimit', config('database.pagination.limit')); $data = $this->repository ->pushFilter(RequestFilter::class) ->pushFilter(ReviewPublicFilter::class) ->setPresenter(ReviewListPresenter::class) ->select('reviews.*') ->paginate($pageLimit) ->withQueryString() ->toArray(); extract($data); $categories = []; $tags = []; $recent = []; return $this->response->setMetaTitle(trans('review::review.names')) ->view('review::public.review.index') ->data(compact('data', 'meta', 'categories', 'tags', 'recent')) ->output(); } /** * Show review. * * @param string $slug * * @return response */ protected function show(PublicRequest $request, $slug) { $data = $this->repository ->findBySlug($slug) ->toArray(); $categories = []; $tags = []; $recent = []; return $this->response->setMetaTitle($data['title'] . trans('review::review.name')) ->view('review::public.review.show') ->data(compact('data', 'categories', 'tags', 'recent')) ->output(); } }