Download the PHP package byteblitz/notify without Composer
On this page you can find all versions of the php package byteblitz/notify. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download byteblitz/notify
More information about byteblitz/notify
Files in byteblitz/notify
Package notify
Short Description package for sending notifications to multi-channels
License MIT
Informations about the package notify
notify
Introduction
Notify is a package that lets you send template based or custom notifications mutli-channel for your project. Channels included : mail, fcm, sms, whatsapp
Installation
You can install the package using composer
Then add the service provider to config/app.php
. In Laravel versions 5.5 and beyond, this step can be skipped if package auto-discovery is enabled.
You can publish the configuration file and assets by running:
This will create a notify.php file in config folder, and update channel details and other.
Now that we have published a few new files to our application we need to reload them with the following command:
Now we have to migrate our notify_templates & notifications tables, migrate by running:
Basic
use this facade in your controller
let's create templates for notifications, you can use seeder to copy the below code :
other template functions :
Now let's start to send notifications with created template:
First use this trait in all guard user model to receive notification
Send notification with use of template, it will send to all the channels we defined on that template: Note : the user object have email and phone fields.
if you want save the notification to db, it will stored in notifications table, add these parameters:
Sending attachments with template, we can send multiple attachments. and that will be sent to mail, and whatsapp if it turn on
If you want to use custom :
Template Usages
Want to send button to mail, to override with variable:
Want to send image to mail, to override with variable:
Config
Config file are located at config/notify.php
after publishing provider element.
Make sure to add all user guards to receive notifications:
Change the email template title, logo or primary colour:
Update channel values or add in .env
file
Get Notifications
Get all received notifications of a user