search; $pageLimit = $request->input('pageLimit', config('database.pagination.limit')); $page = Testimonial::pushScope(new RequestScope()) ->pushScope(new TestimonialPublicScope()) ->select('testimonials.*') ->paginate($pageLimit) ->withQueryString(); $data = new TestimonialsCollection($page); $categories = []; $tags = []; $recent = []; return $this->response->setMetaTitle(trans('testimonial::testimonial.names')) ->view('testimonial::public.testimonial.index') ->data(compact('data', 'categories', 'tags', 'recent')) ->output(); } /** * Show testimonial. * * @param string $slug * * @return response */ protected function show(PublicRequest $request, $slug) { $model = Testimonial::findBySlug($slug); $data = new TestimonialResource($model); $categories = []; $tags = []; $recent = []; return $this->response->setMetaTitle($data['title'] . trans('testimonial::testimonial.name')) ->view('testimonial::public.testimonial.show') ->data(compact('data', 'categories', 'tags', 'recent')) ->output(); } }