PHPackages                             byteblitz/notify - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Mail &amp; Notifications](/categories/mail)
4. /
5. byteblitz/notify

ActiveLibrary[Mail &amp; Notifications](/categories/mail)

byteblitz/notify
================

package for sending notifications to multi-channels

v1.0.6(2y ago)013MITPHP

Since Feb 11Pushed 2y ago1 watchersCompare

[ Source](https://github.com/rahib305/notify)[ Packagist](https://packagist.org/packages/byteblitz/notify)[ RSS](/packages/byteblitz-notify/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (8)Used By (0)

notify
======

[](#notify)

Introduction
------------

[](#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
------------

[](#installation)

You can install the package using composer

```
$ composer require byteblitz/notify
```

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.

```
'providers' => [
    ...
    ByteBlitz\Notify\NotifyServiceProvider::class
    ...
];
```

You can publish the configuration file and assets by running:

```
$ php artisan vendor:publish --provider="ByteBlitz\Notify\NotifyServiceProvider"
```

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:

```
$ composer dump-autoload
```

Now we have to migrate our notify\_templates &amp; notifications tables, migrate by running:

```
$ php artisan migrate
```

Basic
-----

[](#basic)

use this facade in your controller

```
use ByteBlitz\Notify\Facades\Notify;
```

let's create templates for notifications, you can use seeder to copy the below code :

```
$templates = [
  [
      'session'=>'New Registration To Admin',
      'receiver'=> 'admin',
      'slug' => 'new_registration_to_admin',
      'title' => 'New Registration',
      'mail_msg' => "Hy Admin,&nbsp; {name} is registered in ByteBlitz, Please review and verify. ",
      'notification_msg'=>"",
      'variables' => ['name'],
      'channels'=>['mail', 'fcm']
  ],
  [
      'session'=>'Registration success to customer',
      'receiver'=> 'customer',
      'slug' => 'registration_success_to_customer',
      'title' => 'Welcome to ByteBlitz',
      'notification_msg'=>"",
      'mail_msg' => "Hy {name},&nbsp;We'd like to welcome you to ByteBlitz, and thank you for joining us.",
      'variables' => ['name'],
      'channels'=>['mail']
  ],
];

foreach($templates as $template) {
    Notify::createTemplate($template);
}
```

other template functions :

```
//To get template
Notify::getTemplate('slug');
//To update template
Notify::updateTemplate($templateData, $id);
//To delete template
Notify::dropTemplate($id);
//To restore deleted template
Notify::restoreTemplate('slug');
```

Now let's start to send notifications with created template:

First use this trait in all guard user model to receive notification

```
use ByteBlitz\Notify\Trait\NotifyBlitz;
```

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.

```
//variables need to be override so define template variables :
$variables = [
  'name'=>'Jhon'
];
$user->template('registration_success_to_customer', $variables)->notify();
```

if you want save the notification to db, it will stored in notifications table, add these parameters:

```
$user->template('registration_success_to_customer', $variables, true, 'redirection route or url')->notify();
```

Sending attachments with template, we can send multiple attachments. and that will be sent to mail, and whatsapp if it turn on

```
$user->template('registration_success_to_customer', $variables)->->attachments(['../attachment/path'])->notify();
```

If you want to use custom :

```
//mailable class
$user
->customMail(new \App\Mail\CustomMail())
//custom to mail
->toMail('custom@gmail.com')
//custom phone number to send sms or whatsapp notification
->toPhone('+9198776*****')

//send custom messages
->via(['mail', 'fcm', 'whatsapp', 'sms'])
->title('Hellooooo')
->mailMsg('Mail Msg')
->message('notification message')
->notify();
```

Template Usages
---------------

[](#template-usages)

Want to send button to mail, to override with variable:

```
notifyButton('https://www.facebook.com/', 'Create Account');
```

Want to send image to mail, to override with variable:

```
notifyImage('https://picperf.io/https://laravelnews.s3.amazonaws.com/images/laravel-featured.png');
```

Config
------

[](#config)

Config file are located at `config/notify.php` after publishing provider element.

Make sure to add all user guards to receive notifications:

```
'receivers'=>[
    'user'=>App\Models\User::class,
    'admin'=>App\Models\Admin::class
],
```

Change the email template title, logo or primary colour:

```
'mail'=>[
    'title'=>'ByteBlitz',
    'logo'=>'',
    'primary_clr'=>'red'
],
```

Update channel values or add in `.env` file

```
//For firebase
'fcm'=> [
    'server_key'=>env('FCM_SERVER_KEY')
],

//For Whatsapp use ultramsg api provider
'whatsapp'=> [
    'ultramsg'=>[
        'instance_id'=> env('ULTRAMSG_INSTANCE_ID'),
        'token'=> env('ULTRAMSG_TOKEN'),
    ],
    'attachments_allowed'=>[
        'documents'=>['pdf'],
        'images'=>['png', 'jpg']
    ]
],

//For SMS, use twilio
'sms'=> [
    'twilio'=>[
        'sid'=>env('TWILIO_SID'),
        'auth_token'=>env('TWILIO_AUTH_TOKEN'),
        'from'=>env('TWILIO_FROM_NUMBER')
    ]
]
```

Get Notifications
-----------------

[](#get-notifications)

Get all received notifications of a user

```
$user->notifications();
```

###  Health Score

21

—

LowBetter than 18% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity46

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

7

Last Release

827d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/0925c145094beb577c48347877c1684622254d0a6894eddc70db15856568cdf6?d=identicon)[rahib305](/maintainers/rahib305)

---

Top Contributors

[![rahib305](https://avatars.githubusercontent.com/u/53095281?v=4)](https://github.com/rahib305 "rahib305 (10 commits)")

### Embed Badge

![Health badge](/badges/byteblitz-notify/health.svg)

```
[![Health](https://phpackages.com/badges/byteblitz-notify/health.svg)](https://phpackages.com/packages/byteblitz-notify)
```

###  Alternatives

[tijsverkoyen/css-to-inline-styles

CssToInlineStyles is a class that enables you to convert HTML-pages/files into HTML-pages/files with inline styles. This is very useful when you're sending emails.

5.8k505.3M227](/packages/tijsverkoyen-css-to-inline-styles)[minishlink/web-push

Web Push library for PHP

1.9k12.0M53](/packages/minishlink-web-push)[laravel-notification-channels/twilio

Provides Twilio notification channel for Laravel

2587.7M12](/packages/laravel-notification-channels-twilio)[spatie/url-signer

Generate a url with an expiration date and signature to prevent unauthorized access

4422.3M16](/packages/spatie-url-signer)[mattketmo/email-checker

Throwaway email detection library

2742.0M5](/packages/mattketmo-email-checker)[laravel-notification-channels/discord

Laravel notification driver for Discord.

2371.3M11](/packages/laravel-notification-channels-discord)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
