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