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