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