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