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