repository = $attachments; parent::__construct(); } /** * Show attachments's list. * * @param string $slug * * @return response */ protected function index() { $attachments = $this->repository ->pushCriteria(app('Litepie\Repository\Criteria\RequestCriteria')) ->scopeQuery(function($query){ return $query->orderBy('id','DESC'); })->paginate(); return $this->theme->of('file_repository::public.attachments.index', compact('attachments'))->render(); } /** * Show attachments. * * @param string $slug * * @return response */ protected function show($slug) { $attachments = $this->repository->scopeQuery(function($query) use ($slug) { return $query->orderBy('id','DESC') ->where('slug', $slug); })->first(['*']); return $this->theme->of('file_repository::public.attachments.show', compact('attachments'))->render(); } }