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