Fenos\Notifynder\Notifications\NotificationManager::getNotRead PHP Method

getNotRead() public method

Get notifications not read of the entity given.
public getNotRead ( $toId, $limit = null, integer | null $paginate = null, string $orderDate = 'desc', Closur\Closure $filterScope = null ) : mixed
$toId
$limit
$paginate integer | null
$orderDate string
$filterScope Closur\Closure
return mixed
    public function getNotRead($toId, $limit = null, $paginate = null, $orderDate = 'desc', Closure $filterScope = null)
    {
        $queryLimit = $limit;
        if ($this->isPaginated($paginate)) {
            $queryLimit = null;
        }
        $notifications = $this->notifynderRepo->getNotRead($toId, $this->entity, $queryLimit, null, $orderDate, $filterScope);
        return $this->getPaginatedIfNeeded($notifications, $limit, $paginate);
    }

Usage Example

 /** @test */
 function it_retrieve_notification_by_paginating_the_number()
 {
     app('config')->set('notifynder.polymorphic', false);
     $extraValues = json_encode(['look' => 'Amazing']);
     $category = $this->createCategory(['text' => 'parse this {extra.look} value']);
     $notification = $this->createNotification(['extra' => $extraValues, 'category_id' => $category->id]);
     $notifications = $this->notification->getNotRead($notification->to->id, 10, true);
     $bodyParsed = 'parse this Amazing value';
     $this->assertEquals($bodyParsed, $notifications->items()[0]->text);
 }
All Usage Examples Of Fenos\Notifynder\Notifications\NotificationManager::getNotRead