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