public function hasNotifications($type = null)
    {
        if (null !== $type) {
            NotificationTypes::isValidType($type);

            return $this->getNotifications($type)->count();
        }

        return 0 < $this->notifications->count();
    }
public function hasNotifications($type = null)
    {
        if (null !== $type) {
            NotificationTypes::isValidType($type);

            return $this->getNotifications($type)->count();
        }

        return 0 < $this->notifications->count();
    }
Returns whether the notifiable has notifications or not, optionally filtered by type.

@param string $type

@return bool