repository = $bapplan; parent::__construct(); } /** * Show bapplan's list. * * @param string $slug * * @return response */ protected function index() { $bapplans = $this->repository ->pushCriteria(app('Litepie\Repository\Criteria\RequestCriteria')) ->scopeQuery(function($query){ return $query->orderBy('id','DESC'); })->paginate(); return $this->response->title(trans('$bapsplan::$bapplan.names')) ->view('$bapsplan::public.bapplan.index') ->data(compact('$bapplans')) ->output(); } /** * Show bapplan's list based on a type. * * @param string $slug * * @return response */ protected function list($type = null) { $bapplans = $this->repository ->pushCriteria(app('Litepie\Repository\Criteria\RequestCriteria')) ->scopeQuery(function($query){ return $query->orderBy('id','DESC'); })->paginate(); return $this->response->title(trans('$bapsplan::$bapplan.names')) ->view('$bapsplan::public.bapplan.index') ->data(compact('$bapplans')) ->output(); } /** * Show bapplan. * * @param string $slug * * @return response */ protected function show($slug) { $bapplan = $this->repository->scopeQuery(function($query) use ($slug) { return $query->orderBy('id','DESC') ->where('slug', $slug); })->first(['*']); return $this->response->title($$bapplan->name . trans('$bapsplan::$bapplan.name')) ->view('$bapsplan::public.bapplan.show') ->data(compact('$bapplan')) ->output(); } }