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