Download the PHP package simianbv/notifications without Composer
On this page you can find all versions of the php package simianbv/notifications. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download simianbv/notifications
More information about simianbv/notifications
Files in simianbv/notifications
Package notifications
Short Description Subscription-based notification broker for Laravel
License MIT
Informations about the package notifications
Notification Broker
Subscription-based notification broker for Laravel. Employees subscribe to notification types (optionally scoped to a specific entity) and receive database + broadcast notifications when events occur.
Installation
The service provider is auto-discovered. Publish and run the migration:
Configuration
Publish the config file:
This creates config/notifications.php:
Usage
Sending notifications
The method returns the number of subscribers notified.
Custom message and link resolvers
Register resolvers in a service provider to generate messages and links dynamically per type:
When resolvers are registered you can omit the $message and $link arguments:
Without resolvers or explicit arguments, the default message is "{Type} #{id} is bijgewerkt." and the link is null.
API routes
The routes use the middleware and prefix from the config.
| Method | URI | Description |
|---|---|---|
GET |
/subscriptions |
List all current user's subscriptions by type |
GET |
/subscriptions/{type}/{entityId?} |
List current user's subscriptions for a type |
POST |
/subscriptions/{type}/{entityId?} |
Subscribe current user |
DELETE |
/subscriptions/{type}/{entityId?} |
Unsubscribe current user |
GET |
/subscriptions/{type}/{entityId?}/subscribers |
List all subscribers |
Examples
License
MIT