repository = $bus_categories; parent::__construct(); } /** * Show bus_categories'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_categories.names')) ->view('$bus_category::public.bus_categories.index') ->data(compact('$bus_categories')) ->output(); } /** * Show bus_categories'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_categories.names')) ->view('$bus_category::public.bus_categories.index') ->data(compact('$bus_categories')) ->output(); } /** * Show bus_categories. * * @param string $slug * * @return response */ protected function show($slug) { $bus_categories = $this->repository->scopeQuery(function($query) use ($slug) { return $query->orderBy('id','DESC') ->where('slug', $slug); })->first(['*']); return $this->response->title($$bus_categories->name . trans('$bus_category::$bus_categories.name')) ->view('$bus_category::public.bus_categories.show') ->data(compact('$bus_categories')) ->output(); } }