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->theme->of('file_repository::public.notifications.index', compact('notifications'))->render(); } /** * 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->theme->of('file_repository::public.notifications.show', compact('notifications'))->render(); } }