PHPackages                             zerockvnext/notice - 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. [Queues &amp; Workers](/categories/queues)
4. /
5. zerockvnext/notice

ActiveLibrary[Queues &amp; Workers](/categories/queues)

zerockvnext/notice
==================

v1.0.1(8y ago)270MITPHPPHP &gt;=5.6.4

Since Jan 23Pushed 8y agoCompare

[ Source](https://github.com/ZerockvNext/Notice)[ Packagist](https://packagist.org/packages/zerockvnext/notice)[ RSS](/packages/zerockvnext-notice/feed)WikiDiscussions master Synced 4d ago

READMEChangelogDependencies (5)Versions (3)Used By (0)

Noice (Laravel 5 Notice package)
================================

[](#noice-laravel-5-notice-package)

This library is a concise web application notification center to **Laravel 5**

I have only tested on Laravel 5, not sure if it's available on Laravel4.

Contents
--------

[](#contents)

- [Installation](#installation)
- [Configuration](#configuration)
- [Usage](#usage)
- [License](#license)

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

[](#installation)

1. Install use composer

```
composer require "zerockvnext/notice:~1.0"
```

2. Open your `config/app.php` and add the following to the `providers` array:

```
ZerockvNext\Notice\NoticeServiceProvider::class,
```

3. In the same `config/app.php` and add the following to the `aliases ` array:

```
'Notice' => ZerockvNext\Notice\NoticeFacade::class,
```

4. Run the command below to publish the package config &amp; migration files:

```
php artisan vendor:publish --provider="ZerockvNext\Notice\NoticeServiceProvider"
```

5. Run migrate

```
php artisan migrate
```

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

[](#configuration)

1. Open your `config/notice.php` and add the following to the `orm` array:

```
'orm' => [
    'user' => \App\User::class
],
```

chang it to your User ORM

Usage
-----

[](#usage)

### Send Message

[](#send-message)

```
    Notice::PostOffice()
        ->type(Notice::Consts()->typeMessage())
        ->sender(1) // Sender ID
        ->title('test message')
        ->message('message contents. this is a test message!')
        ->addReceiver(2) // Receiver ID
        ->addReceivers([3, 4, 5, 6, 7]) // Receivers
        ->send();
```

In this code, title() and message() are **not necessary**.

```
Notice::Consts()->typeMessage() // message, someone send message to someone else.
Notice::Consts()->typeNotice() // notice, announcement by someone.
Notice::Consts()->typeSystem() // system, messages sent by the system.
```

type() can receive 'message', 'notice' and 'system', default type is 'message'.

### MailBox

[](#mailbox)

#### Receive Message

[](#receive-message)

```
$Messages = Notice::MailBox()
    ->receiver(4) // Receiver ID
    ->getPagedMessages(1, 10); // Page, Limited, Type = null

$Totals = Notice::MailBox()
    ->totalMessages(); // Type = null

return [
    'messages' => $Messages, // Paged messages
    'totals'   => $Totals, // Total count of messages
];
```

or like this

```
Notice::MailBox()->receiver(4) // Receiver ID
$Messages = Notice::MailBox()->getPagedMessages(1, 10, Notice::Consts()->typeMessage());
$Totals   = Notice::MailBox()->totalMessages(Notice::Consts()->typeMessage());

return [
    'messages' => $Messages, // Paged messages
    'totals'   => $Totals, // Total count of messages
];
```

If you set the value of $Type, then this method will return the result of the corresponding type.

#### Count Messages

[](#count-messages)

```
Notice::MailBox()->receiver(4);

Notice::MailBox()->hasUnread(); // Type = null, return bool
Notice::MailBox()->hasUnread(Notice::Consts()->typeMessage());

Notice::MailBox()->totalUnread(); // Type = null, return unread count num
Notice::MailBox()->totalUnread(Notice::Consts()->typeMessage());

Notice::MailBox()->totalMessages(); // Type = null, return count num
Notice::MailBox()->totalMessages(Notice::Consts()->typeMessage());

Notice::MailBox()->countUnread(); // Type = null
// return array like this ['message' => 5, 'notice' => 2, 'system' => 3]

Notice::MailBox()->countUnread(Notice::Consts()->typeMessage());
// return array like this ['message' => 5]
```

#### Get Specified Message

[](#get-specified-message)

```
$Message = Notice::MailBox()->receiver(4)->getTransfer(1) // Transfer ID

return [
    'message' => $Message, // Message
];
```

Note: Only message for this receiver can be obtained.

#### Read / Unread

[](#read--unread)

```
Notice::MailBox()->receiver(4)->read(1) // Transfer ID
Notice::MailBox()->receiver(4)->read([1,2,3,4]) // Transfer IDs

Notice::MailBox()->receiver(4)->readAll();
Notice::MailBox()->receiver(4)->readAll(Notice::Consts()->typeMessage()); // Type

Notice::MailBox()->receiver(4)->unread(1) // Transfer ID
Notice::MailBox()->receiver(4)->unread([1,2,3,4]) // Transfer IDs
```

Note: Only the corresponding receiver can modify message status.

#### Remove Message

[](#remove-message)

```
Notice::MailBox()->receiver(4)->remove(1) // Transfer ID
Notice::MailBox()->receiver(4)->remove([1,2,3,4]) // Transfer IDs
```

#### View Remove Message

[](#view-remove-message)

```
Notice::MailBox()->mode(Notice::Consts()->modeRecycled());

$Messages = Notice::MailBox()
    ->receiver(4)
    ->getPagedMessages(1, 10);

$Totals = Notice::MailBox()->totalMessages();

return [
    'messages' => $Messages, // Paged messages
    'totals'   => $Totals, // Total count of messages
];
```

you can use those values:

```
Notice::Consts()->modeAll() // return null, all messages
Notice::Consts()->modeWithoutRecycled() // return true, default, only not recycled
Notice::Consts()->modeRecycled() // return false, only recycled
```

License
-------

[](#license)

MIT license.

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity59

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

Total

2

Last Release

3028d ago

### Community

Maintainers

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

---

Top Contributors

[![ZerockvNext](https://avatars.githubusercontent.com/u/27279359?v=4)](https://github.com/ZerockvNext "ZerockvNext (9 commits)")

---

Tags

composercomposer-packagelaravellaravel-5-packagemessagenoticenotifypackagephpmessagelaravelnotifynotice

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/zerockvnext-notice/health.svg)

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

###  Alternatives

[laravel/cashier

Laravel Cashier provides an expressive, fluent interface to Stripe's subscription billing services.

2.5k25.9M107](/packages/laravel-cashier)[laravel/pulse

Laravel Pulse is a real-time application performance monitoring tool and dashboard for your Laravel application.

1.7k12.1M99](/packages/laravel-pulse)[nahid/talk

Talk is a Laravel based realtime messaging, chatting and conversation system. It helps to develop users messaging, chatting and conversations in easy way.

1.6k58.1k4](/packages/nahid-talk)[fumeapp/modeltyper

Generate TypeScript interfaces from Laravel Models

196277.9k](/packages/fumeapp-modeltyper)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

245.2k](/packages/aedart-athenaeum)

PHPackages © 2026

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