modules = $this->modules(config('mon.test.modules'), 'test', guard_url('test')); $this->repository = $test; } /** * Show test'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(TestPublicFilter::class) ->setPresenter(TestListPresenter::class) ->select('tests.*') ->paginate($pageLimit) ->withQueryString() ->toArray(); extract($data); $categories = []; $tags = []; $recent = []; return $this->response->setMetaTitle(trans('test::test.names')) ->view('test::public.test.index') ->data(compact('data', 'meta', 'categories', 'tags', 'recent')) ->output(); } /** * Show test. * * @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('test::test.name')) ->view('test::public.test.show') ->data(compact('data', 'categories', 'tags', 'recent')) ->output(); } }