Download the PHP package imagina/inotification without Composer
On this page you can find all versions of the php package imagina/inotification. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download imagina/inotification
More information about imagina/inotification
Files in imagina/inotification
Package inotification
Short Description Module handling the real time notifications
License MIT
Informations about the package inotification
Inotification module 4.1.1
Improved version of the Asgard Notification Module - https://github.com/AsgardCms/Notification
Realease Notes
Added
- Rules
CreateNotificationRequest
- Validation message for request rules
Labs Mobile
default provider for SMS notificationsProvider
,Rule
,Template
andTypeNotification
Asgard Entities ScaffolddefaultEmailView
configprovider
andrecipient
columns intonotification__notifications
tablenotificationTypes
config to be seeded in the notification__notification_types tableproviders
config to add new providers configurationsNotificationTypeTableSeeder
depending on the configEventServiceProvider
to listening dynamically all the events defined in the configproviders
NotificationHandler
to handle all the events listened by theEventServiceProvider
Rule->conditions
validationsImaginaNotification
improved version of theAsgardNotification
Note
with the new
ImaginaNotification
service, the columnuser_id
was replaced byrecipient
in the tablenotification__notifications
Installation
Composer
Execute the following command in your terminal:
Note
After installation you'll have to give you the required permissions to get to the blog module pages in the backend.**
Run migrations and seeders
Providers configuration
/Config/config.php
Option | Description | Required |
---|---|---|
name | Name to show in frontend administrator | Yes |
systemName | Name to use in backend | Yes |
icon | Icon to use in frontend administrator | No |
color | Color to use in frontend administrator | No |
rules | Rules to validate the recipient, see the available rules | No |
fields | Fields necessary to configure the provider, see the Provider Fields | Yes |
settings | the available settings for each rules | No |
Provider Fields
All the fields necessary to configure the provider: api keys, login, user names, passwords.
Each field need to be defined with the dynamic fields
configuration in the basequasar-app. Here a list of the fields required:
Option | Description | Required |
---|---|---|
id | it's necessary to the crud in frontend, only the value it's necessary: |
Yes |
status | a select field with Enable/Disable options ('1' or '0') | Yes |
default | a checkbox field for the default provider by type of notification | Yes |
type | Type of the notification, defined in the config notificationTypes and seeded in the notification__notification_types |
Yes |
saveInDatabase | required field for save in the notification__notifications table or not |
Yes |
Note
Each Provider field can define the route to the public config to replace the keys from ENV file, just add the configRoute value:
this setting is only used at the time of sending a notification, the rest of the application will continue to use the settings from the .env file.
Provider Settings
The settings necessary to customize the fields of the provider for each Rule
Each setting need to be defined with the dynamic fields
configuration in the basequasar-app. Here a list of the settings required:
Option | Description | Required |
---|---|---|
status | a select field with Enable/Disable options ('1' or '0') | Yes |
saveInDatabase | required field for save in the notification__notifications table or not |
Yes |
Note
the required fields of the Provider have more precedence over the Rule Settings.
Publish the configuration
Usage
There is two ways for use the sending of notifications:
1 Quickly send notifications to your frontend application.
Inject the Modules\Notification\Services\Inotification
interface where you need it and assign it to a class variable.
2 Using Events and defining the Notifiable config in each module to administrate from the database by the Rules
Notifiable Configuration
First in each module you need to define the Notifiable config, the Notification module will be detect the configuration and will sending to the frontend for the creation of the Rules, each Rule need to be saved in the database for having effect.
Option | Description | Required |
---|---|---|
title | Name of the entity to show in frontend administrator | Yes |
entityName | Class Path Name for an unique name for the notifiable, example: Modules\\ModuleName\\Entities\\EntityName |
Yes |
events | Array of arrays for all the events notifiable to the entity, only needs the title (for the frontend) and path (class path name) |
Yes |
conditions | Conditions to validate the Rule, if is empty the Rule will be executed without restrictions, see the Notifiable conditions configuration | No |
settings | array to add options to the provider settings | No |
Notifiable conditions configuration
The conditions are configured like the dynamic fields of the basequasar-app. however, there are only 3 types of conditions available:
1 recursive
2 select with static options
3 select with dynamic options
Note
All conditions require the
any
default value, the handle detects it and validates it
Event Example
Notifiable Config Example
Provider Config Example providers
Flow Chart
All versions of inotification with dependencies
composer/installers Version ~1.0
imagina/core-module Version ^10.0
kawankoding/laravel-fcm Version ^0.2.0
symfony/http-client Version ^6.4
symfony/mailgun-mailer Version ^6.4