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