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