PHPackages                             technovistalimited/notific - 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. technovistalimited/notific

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

technovistalimited/notific
==========================

Laravel simple, static and minimal notification system

1.0.2(4y ago)4234↓100%GPL-2.0+PHP

Since May 11Pushed 4y ago2 watchersCompare

[ Source](https://github.com/technovistalimited/notific)[ Packagist](https://packagist.org/packages/technovistalimited/notific)[ RSS](/packages/technovistalimited-notific/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (7)Dependencies (1)Versions (10)Used By (0)

🔔 Notific
=========

[](#-notific)

Notific is a simple, and minimal, static notification system for Laravel. It stores notification data based on user\_id, and fetch notifications for the user\_id. It's not *that* feature rich.

The package **has no UI**, it just a database based cached data-driven mechanism of organized methods. You have to build you own UI.

[![GitHub release](https://camo.githubusercontent.com/84df8c2eef9615a93ea7e0a9de24587f04367473064633e4e3a1a0e0fd4e8b25/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652d7072652f746563686e6f76697374616c696d697465642f6e6f74696669632e7376673f7374796c653d666c61742d737175617265)](https://github.com/technovistalimited/notific/releases)[![GitHub license](https://camo.githubusercontent.com/2c2f4016cb1f0dd12337a56883b9c638773e771966c7bdfc8c0b1d927e85c723/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d47504c322e302b2d626c75652e7376673f7374796c653d666c61742d737175617265)](https://raw.githubusercontent.com/technovistalimited/notific/master/LICENSE.txt)[![Laravel package](https://camo.githubusercontent.com/fb1af8adc0ed510cd09b1c6379a051ae3c5a61f769382ca9b2e27defda6b33df/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c61726176656c2d7965732d6f72616e67652e7376673f7374796c653d666c61742d737175617265)](https://laravel.com/)

**License:** GPL-2.0+
**Requires:** Laravel 5.8
**Tested up to:** Laravel 8.x
**Developers:** [Mayeenul Islam](https://github.com/mayeenulislam), [Nazmul Hasan](https://github.com/nazmulcse)

---

_________NOTICE_________
The package is developed for the organization's internal use only. If it helps you, that's why it's here. We might not support the package full throttle. But bug reports are welcome.

---

Table of Contents
-----------------

[](#table-of-contents)

- [Features](#features)
- [Installation](#installation)
    - [Step 1: Download &amp; Setup](#step-1-download--setup)
        - [Providers array](#providers-array)
        - [Aliases array](#aliases-array)
    - [Step 2: Publish the Necessary files](#step-2-publish-the-necessary-files)
    - [Step 3: Make tables ready](#step-3-make-tables-ready)
- [Configuration](#configuration)
    - [Cache status](#cache-status)
    - [Cache time](#cache-time)
- [API: How to use](#api-how-to-use)
    - [Store notification](#store-notification)
    - [Get notifications](#get-notifications)
    - [Get notification count](#get-notification-count)
    - [Mark notification as *read*](#mark-notification-as-read)
- [Examples](#examples)
    - [01. Create a notification](#01-create-a-notification)
    - [02. Get notifications](#02-get-notifications)
    - [03. Get notification count](#03-get-notification-count)
    - [04. Mark notification as *read*](#04-mark-notification-as-read)
    - [05. Maybe Unserialize](#05-maybe-unserialize)
- [Contributions](#contributions)
- [Uninstallation](#uninstallation)
- [Credits](#credits)

Features
--------

[](#features)

- Database table creation using migration
- Store notifications into the database
- Fetch notifications from the database
- Store and fetch any types of additional information for notification with metadata
- Cached data to save some valuable resources - configurable

Features that are *not* present:

- Event listener and real-time notification (but you can easily extend into those)

Installation
------------

[](#installation)

### Step 1: Download &amp; Setup

[](#step-1-download--setup)

Open up the command console on the root of your app and run:

```
composer require technovistalimited/notific
```

#### Providers array

[](#providers-array)

Add the following string to the `config/app.php` under `providers` array:

```
Technovistalimited\Notific\NotificServiceProvider::class,
```

#### Aliases array

[](#aliases-array)

Add the following line to the `config/app.php` under `aliases` array:

```
'Notific' => Technovistalimited\Notific\Facades\Notific::class,
```

### Step 2: Publish the Necessary files

[](#step-2-publish-the-necessary-files)

Make the configuration and migration files ready first; in the command console, type and hit enter:

```
php artisan vendor:publish --tag=notific
```

### Step 3: Make tables ready

[](#step-3-make-tables-ready)

Open up the command console on the root of your app and run the migrations:

```
php artisan migrate
```

Configuration
-------------

[](#configuration)

Change configuration in `config/notific.php`.

### Cache status

[](#cache-status)

Set whether to use the cache or not, under `'cache' => ['is_cache']`. Accepted value: `true` (enabled), `false` (disabled)
Default: *true* - enabled

### Cache time

[](#cache-time)

Change the time under `'cache' => ['cache_time']`. Accepted value: any positive integer to denote seconds.
Default: *10* minutes

API: How to use
---------------

[](#api-how-to-use)

If you defined the helper class correctly, the package is easy to use:

### Store notification

[](#store-notification)

To store notification, simply place the following method where you want to plug it into. The method will also clear the cache for the user to update the notification history.

```
Notific::notify( $userId, $message, $notificationType, $metaData, $createdBy );
```

> **$userID** : *integer/array*
> User ID or array of user IDs to notify.
>
> **$message** : *string*
> The message with which you want to notify with.
>
> **$notificationType** : *string* : (optional)
> The notification type if you have any, other than notification.
> *default: `'notification'`*
>
> **$metaData** : *integer/string/array* : (optional)
> Whatever additional information you want to pass with. Whether pass them as integer, string or as an array.
> *default: empty*
>
> **$createdBy** : *integer* : (optional)
> If you want to keep trace who issued the notification.
> *default: empty*

### Get notifications

[](#get-notifications)

Get the notifications by user ID.

```
Notific::getNotifications( $userId, $arguments );
```

> **$userID** : *integer*
> User ID for which to fetch the notifications.
>
> **$arguments** : *array* : (optional)
> Array of Query parameters. *default: `array()` - fetch notifications based on default settings*
>
> > **$read\_status** : *string*
> > The notification read status. Accepts: `'all'`, `'read'`, `'unread'`.
> > *default: `'all'`*
> >
> > **$order** : *string*
> > Designates ascending or descending order of notifications. Accepts `'ASC'`, `'DESC'`.
> > *default: `'DESC'`*
> >
> > **$orderby** : *string*
> > Sort retrieved posts by parameter. Single option can be passed. Accepts any valid column name from db table.
> > *default: `'created_at'`*
> >
> > **$paginate** : *boolean*
> > Whether to enable pagination or not.
> > *default: `false` - pagination DEactivated*
> >
> > **$items\_per\_page** : *integer*
> > Fetch the number of items. Accepts any positive integer.
> > *default: `-1` - fetch everything*

### Get notification count

[](#get-notification-count)

Get the total count of notifications by user ID.

```
Notific::getNotificationCount( $userId, $status );
```

> **$userID** : *integer*
> User ID for which to fetch the notifications.
>
> **$status** : *string* : (optional)
> The notification read status. Accepts: `'all'`, `'read'`, `'unread'`.
> *default: `all` - fetch all the notification count*

### Mark notification as *read*

[](#mark-notification-as-read)

Mark the notification as *read* when actually they are. You might need AJAX to mark them *read* on the fly.

```
Notific::markNotificationRead( $userId, $notificationId );
```

> **$userID** : *integer*
> User ID to mark the notification as *read* for.
>
> **$notificationId** : *integer* : (optional)
> If you want to mark each of the notification as read, pass the notification ID
> *default: empty - mark all as read*

Examples
--------

[](#examples)

### 01. Create a notification

[](#01-create-a-notification)

With the following examples, a user with the ID `21` will be notified accordingly:

```
// Notified with a simple message.
Notific::notify( 21, 'Your application submitted.' ) );

// Notified with a message and date.
Notific::notify( 21, sprintf( 'Your application submitted on %s is approved.', date('d F Y') ) );

// Notified with a different type of notification.
Notific::notify( 21, 'Your application submitted.', 'message' ) );

// Notified with some meta data incorporated.
Notific::notify( 21, 'Your application is approved. Click to see it.', 'notification', array('link' => 'http://link.to/the/application/' ) ) );

// Notified with someone who (with ID 8) assigned the notification
Notific::notify( 21, 'Your application submitted.', 'notification', '', 8 ) );

// Notify multiple users (with ID 21, 4, and 5) at a time
Notific::notify( [21, 4, 5], 'An application is submitted. Please check.' );
```

### 02. Get notifications

[](#02-get-notifications)

With the following examples, we're fetching the notifications assigned to a user with ID `21`:

```
// Get all the notifications.
Notific::getNotifications( 21 );

// Get unread notifications only.
Notific::getNotifications( 21, array( 'read_status' => 'unread' ) );

// Get read notifications only.
Notific::getNotifications( 21, array( 'read_status' => 'read' ) );

// Get read notifications and maximum 10 of them only.
Notific::getNotifications( 21, array( 'read_status' => 'all', 'items_per_page' => 10 ) );

// Get all notifications and paginate them to 50 per page only.
Notific::getNotifications( 21, array( 'paginate' => true, 'items_per_page' => 50 ) );
```

### 03. Get notification count

[](#03-get-notification-count)

With the following examples, we're fetching the count of notifications assigned to a user with ID `21`:

```
// Get all notifications of the user ID 21.
Notific::getNotificationCount( 21 );
Notific::getNotificationCount( 21, 'all' );

// Get only the 'unread' notifications of the user ID 21.
Notific::getNotificationCount( 21, 'unread' );

// Get only the 'read' notifications of the user ID 21.
Notific::getNotificationCount( 21, 'read' );
```

### 04. Mark notification as *read*

[](#04-mark-notification-as-read)

```
// Mark all the notifications as 'read' for the user with ID 21.
Notific::markNotificationRead( 21 );

// Mark notification number 56 as 'read' for the user with ID 21.
Notific::markNotificationRead( 21, 56 );
```

### 05. Maybe Unserialize

[](#05-maybe-unserialize)

Adopted from WordPress, this function can detect whether to unserialize a string or not and serialize, if it's a serialized data. If you make custom methods, you might need to convert the serialized meta data back into array - this method will help you then.

```
// Unserialize if serialized.
Notific::maybeUnserialize( $string );
```

Contributions
-------------

[](#contributions)

Any bug report is welcome. We might not support the package as you might require. But we will definitely try to fix the bugs as long as they meet our leisure.

If you want to contribute code, feel free to add [Pull Request](https://github.com/technovistalimited/notific/pulls).

Uninstallation
--------------

[](#uninstallation)

- Search the whole project of any declaration of `Notific::`, and remove the functions from the source, or comment them out. Otherwise, they will generate a fatal error after uninstallation.
- Open `config/app.php` and remove the line `...NotificServiceProvider::class` under `providers` and `aliases` array.
- Remove the configuration file `notific.php` in `config/notific.php`
- Remove the notific migration files from `database/migrations/`
- Delete the two database tables manually (as the package is not released): table:`notifications`, and table:`user_notifications`

Now, open up the command console, and type:

```
composer remove technovistalimited/notific
```

You are done!

Credits
-------

[](#credits)

All the credit goes to the almighty God first. Thanks to Mr. Amiya Kishore Saha who let both of us make our first Laravel package. Thanks to Mr. Kamrul Hasan for reviewing the progress and suggesting his ideas. And thanks to [TechnoVista Limited](http://technovista.com.bd/) for supporting the initiative. Thanks to [Notifynder](https://github.com/fenos/Notifynder) - a Laravel notification package available at Packagist from Fabrizio - we followed them to learn. Thanks to [WordPress](https://wordpress.org/) - a GPL licensed web framework - we took some of their code thankfully.

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity69

Established project with proven stability

 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 ~184 days

Recently: every ~364 days

Total

9

Last Release

1808d ago

Major Versions

v0.2.0 → 1.0.02021-04-07

### Community

Maintainers

![](https://www.gravatar.com/avatar/fdccf53b382921565648eb2ac9994cec22627c19dc385ac93ad5bd8a5e2fbb04?d=identicon)[mayeenulislam](/maintainers/mayeenulislam)

---

Top Contributors

[![mayeenulislam](https://avatars.githubusercontent.com/u/4551598?v=4)](https://github.com/mayeenulislam "mayeenulislam (28 commits)")

---

Tags

laravelnotificationreusable-componentslaravelnotification

### Embed Badge

![Health badge](/badges/technovistalimited-notific/health.svg)

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

PHPackages © 2026

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