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