Fenos\Notifynder\Notifications\NotificationRepository::getAll PHP Method

getAll() public method

You can also limit the number of Notifications if you don't, it will get all.
public getAll ( $toId, $entity, null $limit = null, integer | null $paginate = null, string $orderDate = 'desc', Closur\Closure $filterScope = null ) : mixed
$toId
$entity
$limit null
$paginate integer | null
$orderDate string
$filterScope Closur\Closure
return mixed
    public function getAll($toId, $entity, $limit = null, $paginate = null, $orderDate = 'desc', Closure $filterScope = null)
    {
        $query = $this->notification->with('body', 'from')->wherePolymorphic($toId, $entity)->orderBy('read', 'ASC')->orderBy('created_at', $orderDate);
        if ($limit && !$paginate) {
            $query->limit($limit);
        }
        $query = $this->applyFilter($filterScope, $query);
        if (is_int(intval($paginate)) && $paginate) {
            return $query->paginate($limit);
        }
        return $query->get();
    }