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