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