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