Fenos\Notifynder\Models\NotifynderCollection::parse PHP Method

parse() public method

Parse the body of the notification.
public parse ( )
    public function parse()
    {
        $parser = new NotifynderParser();
        foreach ($this->items as $key => $item) {
            $this->items[$key]['notify_body'] = $parser->parse($item);
            $this->items[$key]['text'] = $this->items[$key]['notify_body'];
        }
        return $this;
    }

Usage Example

 protected function getPaginatedIfNeeded(NotifynderCollection $notifications, $perPage, $paginate)
 {
     if (!$this->isPaginated($paginate)) {
         return $notifications->parse();
     } elseif ($paginate === true) {
         $paginate = null;
     }
     $page = LengthAwarePaginator::resolveCurrentPage();
     $total = $notifications->count();
     $notifications = $notifications->forPage($page, $perPage);
     return new LengthAwarePaginator($notifications->parse(), $total, $perPage, $paginate, ['path' => LengthAwarePaginator::resolveCurrentPath()]);
 }