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