inertia start

v1.3.0

v1.3.0

This release lets notification types be grouped on the account notification preferences page, and keeps each type's configuration in a single definition object.

Added

  • Added App\Services\NotificationTypeDefinition, a readonly object holding a notification type's default state and its optional group. NotificationType::definition() returns it for each case, and defaultEnabled() now reads from it.
  • Added NotificationType::group(), returning the slug of the group a notification type belongs to, or null when it stands on its own.
  • Added grouped rendering to /account/notifications. Notification types that declare a group are listed together under a parent checkbox reflecting the state of its children: checked when all of them are enabled, unchecked when none are, and indeterminate in between. Toggling the parent enables or disables every notification in the group.
  • Group titles and descriptions are read from pages.notifications.groups.{group}.title and pages.notifications.groups.{group}.description.

Changed

  • Each entry of the notification preferences page notifications prop now carries a group value: null, or an object with the group's slug, title, and description.

Dependencies

  • Updated minor and patch versions of Composer and npm dependencies.

Upgrade Guide

  1. Rebuild frontend assets with npm run build or your normal frontend workflow.
  2. If you added your own cases to App\Enums\NotificationType, move each case from the defaultEnabled() match into the definition() match and return new NotificationTypeDefinition(defaultEnabled: ...). defaultEnabled() no longer matches on cases itself, so a case left only there raises an unhandled match error.
  3. To group notification types, pass group: 'your_group' to their NotificationTypeDefinition and add pages.notifications.groups.your_group.title and .description to each locale's pages.php. Missing keys are rendered as the raw translation key.
  4. If you customized resources/js/pages/account/notifications/Notifications.vue, merge the grouped rendering, or at least the new group key on the NotificationType interface.