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