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