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