Skip to content

BaseNotification: one definition, every channel #2

Closed

Description

@n4ff4h

Define the message and data once and get mail, database, broadcast, FCM and SMS (javaabu/sms-notifications) formats. Channels are chosen per notifiable preference.

Activity

  1. added
    next-genNext-gen Javaabu packages
    featurePackage feature from the spec
    on Nov 4, 2026
  2. n4ff4h commented on Nov 5, 2026

    @n4ff4h
    CollaboratorAuthor

    Decisions for future readers:

    • Notifiables use Javaabu\Notifications\Concerns\Notifiable instead of Laravel's Notifiable (same API), so notifications() returns the package's DatabaseNotification model and the broadcast channel works with any guard.
    • Channel names sms and fcm are aliases: sms resolves to the channel of javaabu/sms-notifications' configured driver (sms.default), fcm to NotificationChannels\Fcm\FcmChannel. FCM is optional (suggest) and skipped when it isn't installed.
    • broadcast isn't a preference; it's added automatically next to database when live updates are on (Live notifications with Reverb (optional) #7).
    • Preferences are stored per type key (OrderShippedNotification → order-shipped) with * as the fallback; notifications.required_channels (default ['database']) can't be turned off.
    • The notifiable's locale comes from HasLocalePreference or the locale attribute (notifications.locale_attribute), and every channel's text, including the mail layout's own words, is built in it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    featurePackage feature from the specnext-genNext-gen Javaabu packages

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions