ExecuteNotificationStrategy job iterates every audience on the notification, resolves its members into profiles, and creates delivery records for each one.
Audience Types
TheAudienceType enum defines three ways to compose an audience:
Static
A manually curated list of profiles. Members are stored in the
notification_center_audience_profile pivot table and do not change unless explicitly edited.Best for one-off sends to a known, fixed set of recipients.Dynamic
Membership is resolved at query time using
criteria rules stored on the audience record. The audience evaluates which profiles match the criteria every time it is resolved.Best for recurring notifications where the recipient set evolves over time.Segment
Named reusable cohorts built from profile attributes and Spatie Tags. Define a segment once and attach it to multiple notifications.Best for persona-based or attribute-driven targeting (e.g., “premium users”, “US region”).
Audience Model Fields
Profiles
A Profile is the notification-specific representation of a notifiable entity. Profiles act as the bridge between your application’s user models and the notification delivery system. Key characteristics of theProfile model:
- Uses a polymorphic
notifiablerelationship (notifiable_type/notifiable_id), so any Eloquent model in your application (e.g.,User,Admin) can be a profile owner. - Implements Laravel’s
Notifiabletrait, making it a first-class notification recipient. - Supports Web Push via the
HasPushSubscriptionstrait (fromlaravel-notification-channels/webpush). - Supports Spatie Tags via the
HasTagstrait, enabling segment membership. - Stores channel-specific contact details through a
subscriptionsrelationship.
Relationships
Attaching Audiences to a Notification
Create or select an audience
Navigate to Audiences in the Nova sidebar. Create a new audience, choose its type, and configure members or criteria.
Open the notification
Go to Notifications in the Nova sidebar and open the draft notification you want to publish.
Attach audiences
Use the Audiences relationship panel on the notification detail page to attach one or more audiences.