LogoLogo
  • Introduction
  • What's New?
  • Upgrade Guide
  • Getting Started
    • Requirements
    • Installation
  • Defining Channels
    • Configuration
    • Retrieving Channels
  • Creating and Sending Notifications
    • Defining Notifications
    • Notifiables
    • Sending Notifications
  • Providers
    • DatabaseProvider
    • EmailProvider
    • SlackProvider
      • Slack BlockKit
    • Creating Custom Providers
  • Testing
    • Coming Soon
  • Reference
    • NotificationService
    • BaseNotification
    • SendsNotifications
    • INotifiable
    • BaseProvider
      • DatabaseProvider
        • DatabaseNotificationService
        • HasDatabaseNotifications
        • DatabaseNotificationCursor
        • DatabaseNotification
      • EmailProvider
      • SlackProvider
        • SlackMessage
          • EventMetadata
          • ActionsBlock
          • ContextBlock
          • DividerBlock
          • HeaderBlock
          • ImageBlock
          • SectionBlock
          • ButtonElement
          • ConfirmObject
          • ImageElement
          • TextObject
          • PlainTextOnlyTextObject
  • ForgeBox
  • GitHub
Powered by GitBook
On this page
  • getNotifications
  • getReadNotifications
  • getUnreadNotifications
  1. Reference
  2. BaseProvider
  3. DatabaseProvider

DatabaseNotificationService

getNotifications

Returns all database notifications for a Notifiable.

Name
Type
Required
Default
Description

notifiable

true

channelName

string

false

database

The name of the channel to retrieve notifications from. Defaults to database.

initialPage

numeric

false

1

The initial page of the returned DatabaseNotificationCursor.

maxRows

numeric

false

25

The number of rows per page for the returned DatabaseNotificationCursor.

Return: A DatabaseNotificationCursor to interact with a paginated list of notifications for the notifiable.

Throws: Megaphone.Configuration.MissingChannel

Throws: Megaphone.Configuration.InvalidChannelProvider

getReadNotifications

Returns all read database notifications for a Notifiable.

Name
Type
Required
Default
Description

notifiable

true

channelName

string

false

database

The name of the channel to retrieve read notifications from. Defaults to database.

initialPage

numeric

false

1

The initial page of the returned DatabaseNotificationCursor.

maxRows

numeric

false

25

The number of rows per page for the returned DatabaseNotificationCursor.

Return: A DatabaseNotificationCursor to interact with a paginated list of read notifications for the notifiable.

Throws: Megaphone.Configuration.MissingChannel

Throws: Megaphone.Configuration.InvalidChannelProvider

getUnreadNotifications

Returns all unread database notifications for a Notifiable.

Name
Type
Required
Default
Description

notifiable

true

channelName

string

false

database

The name of the channel to retrieve unread notifications from. Defaults to database.

initialPage

numeric

false

1

The initial page of the returned DatabaseNotificationCursor.

maxRows

numeric

false

25

The number of rows per page for the returned DatabaseNotificationCursor.

Return: A DatabaseNotificationCursor to interact with a paginated list of unread notifications for the notifiable.

Throws: Megaphone.Configuration.MissingChannel

Throws: Megaphone.Configuration.InvalidChannelProvider

PreviousDatabaseProviderNextHasDatabaseNotifications

Last updated 1 year ago

The instance to retrieve notifications for.

The instance to retrieve read notifications for.

The instance to retrieve unread notifications for.

INotifiable
INotifiable
INotifiable
INotifiable
INotifiable
INotifiable