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 3w 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 47% 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

3075d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/27279359?v=4)[冷夜草](/maintainers/ZerockvNext)[@ZerockvNext](https://github.com/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/pulse

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

1.7k15.1M129](/packages/laravel-pulse)[laravel/ai

The official AI SDK for Laravel.

1.0k3.2M184](/packages/laravel-ai)[illuminate/queue

The Illuminate Queue package.

21332.6M1.5k](/packages/illuminate-queue)[larastan/larastan

Larastan - Discover bugs in your code without running it. A phpstan/phpstan extension for Laravel

6.5k55.4M8.2k](/packages/larastan-larastan)[spatie/laravel-responsecache

Speed up a Laravel application by caching the entire response

2.8k9.0M68](/packages/spatie-laravel-responsecache)[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M346](/packages/psalm-plugin-laravel)

PHPackages © 2026

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