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('order::status.names')) ->view('order::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('order::status.name')) ->view('order::public.status.show') ->data(compact('status')) ->output(); } }