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