/**
* Get All notifications
*
* @param $to_id
* @param $limit
* @param int|null $paginate
* @param string $orderDate
* @param Closure $filterScope
* @return mixed
*/
public function getAll($to_id, $limit = null, $paginate = null, $orderDate = 'desc', Closure $filterScope = null)
{
$notifications = $this->notifynderRepo->getAll($to_id, $this->entity, $limit, $paginate, $orderDate, $filterScope);
if (is_int(intval($paginate)) && $paginate) {
return new LengthAwarePaginator($notifications->parse(), $notifications->total(), $limit, $paginate, ['path' => LengthAwarePaginator::resolveCurrentPath()]);
}
return $notifications->parse();
}