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