@@ 173-189 (lines=17) @@ | ||
170 | * @param Closure $filterScope |
|
171 | * @return mixed |
|
172 | */ |
|
173 | public function getNotRead($toId, $limit = null, $paginate = null, $orderDate = 'desc', Closure $filterScope = null) |
|
174 | { |
|
175 | $notifications = $this->notifynderRepo->getNotRead( |
|
176 | $toId, $this->entity, |
|
177 | $limit, $paginate, $orderDate, |
|
178 | $filterScope |
|
179 | ); |
|
180 | ||
181 | if (is_int(intval($paginate)) && $paginate) { |
|
182 | return new LengthAwarePaginator($notifications->parse(), $notifications->total(), $limit, $paginate, [ |
|
183 | 'path' => LengthAwarePaginator::resolveCurrentPath(), |
|
184 | ]); |
|
185 | } |
|
186 | ||
187 | return $notifications->parse(); |
|
188 | } |
|
189 | ||
190 | /** |
|
191 | * Get All notifications. |
|
192 | * |
|
@@ 200-216 (lines=17) @@ | ||
197 | * @param Closure $filterScope |
|
198 | * @return mixed |
|
199 | */ |
|
200 | public function getAll($toId, $limit = null, $paginate = null, $orderDate = 'desc', Closure $filterScope = null) |
|
201 | { |
|
202 | $notifications = $this->notifynderRepo->getAll( |
|
203 | $toId, $this->entity, |
|
204 | $limit, $paginate, $orderDate, |
|
205 | $filterScope |
|
206 | ); |
|
207 | ||
208 | if (is_int(intval($paginate)) && $paginate) { |
|
209 | return new LengthAwarePaginator($notifications->parse(), $notifications->total(), $limit, $paginate, [ |
|
210 | 'path' => LengthAwarePaginator::resolveCurrentPath(), |
|
211 | ]); |
|
212 | } |
|
213 | ||
214 | return $notifications->parse(); |
|
215 | } |
|
216 | ||
217 | /** |
|
218 | * Get last notification of the |
|
219 | * given entity. |