PHPackages                             tihloh/prefab-notifications - 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. tihloh/prefab-notifications

ActiveLibrary

tihloh/prefab-notifications
===========================

Standalone, framework-independent internal application notifications for Prefab PHP.

00PHP

Since Aug 25Pushed todayCompare

[ Source](https://github.com/tihloh/prefab-notifications)[ Packagist](https://packagist.org/packages/tihloh/prefab-notifications)[ RSS](/packages/tihloh-prefab-notifications/feed)WikiDiscussions main Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

Prefab Notifications
====================

[](#prefab-notifications)

**Prefab Notifications** provides framework-independent internal system-to-user notifications for PHP applications.

> Notifications stay inside the application. External delivery belongs to Prefab Messaging.

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

[](#installation)

```
composer require tihloh/prefab-notifications
```

Quick start
-----------

[](#quick-start)

```
use Tihloh\Prefab\Notifications\NotificationManager;

$notifications = new NotificationManager();

$notification = $notifications->send(
    25,
    'Document Approved',
    'OBR-2026-001 has been approved.',
    ['document_id' => 1001],
    '/documents/1001',
);
```

The default store is in-memory, which is useful for tests and small transient usage. Persistent applications can supply a store implementation such as `PdoNotificationStore`.

Reading notifications
---------------------

[](#reading-notifications)

```
$recent = $notifications->recent(25);
$unread = $notifications->unread(25);
$count = $notifications->unreadCount(25);
```

Read state
----------

[](#read-state)

```
$notifications->markRead($notification->id);
$notifications->markUnread($notification->id);
```

Delete/dismiss a notification:

```
$notifications->delete($notification->id);
```

PDO persistence
---------------

[](#pdo-persistence)

```
use Tihloh\Prefab\Notifications\NotificationManager;
use Tihloh\Prefab\Notifications\Stores\PdoNotificationStore;

$notifications = new NotificationManager(
    new PdoNotificationStore($pdo, 'notifications')
);
```

The expected default columns are:

```
id
recipient_id
title
message
metadata
action_url
created_at
read_at

```

Column names can be mapped through the store constructor so an existing application table can be reused.

Scope
-----

[](#scope)

Prefab Notifications owns internal notices such as:

```
System → user
"Document approved"
"New document received"
"Report is ready"

```

It does not own:

```
Email / SMS / external push   → Prefab Messaging
User-to-user chat             → separate future concern
Authentication                → Prefab Auth
Authorization                 → Prefab Permissions
Audit history                 → Prefab Logs

```

An application may intentionally use both modules for the same event:

```
Document Approved
       │
       ├── Prefab Notifications → bell/in-app notice
       └── Prefab Messaging     → email/SMS

```

Neither package requires the other.

API quick reference
-------------------

[](#api-quick-reference)

APIPurpose`send()`Create an internal notification`recent()`Get recent notifications for a recipient`unread()`Get unread notifications`unreadCount()`Count unread notifications`markRead()`Mark a notification read`markUnread()`Restore unread state`delete()`Remove/dismiss a notificationDesign philosophy
-----------------

[](#design-philosophy)

The initial module stays deliberately small. It models internal notification storage and read state without becoming a chat system, external delivery service, real-time socket framework, or workflow engine.

The core principle is: **store and manage simple internal system-to-user notices; add advanced behavior only when real applications require it.**

###  Health Score

20

↑

LowBetter than 12% of packages

Maintenance65

Regular maintenance activity

Popularity0

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity11

Early-stage or recently created project

 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/6ec00222b22ba37eb69aff9973c5303fe5773cb4c7016bf0e7aae09fe9edb232?d=identicon)[tihloh](/maintainers/tihloh)

---

Top Contributors

[![tihloh](https://avatars.githubusercontent.com/u/8960509?v=4)](https://github.com/tihloh "tihloh (8 commits)")

### Embed Badge

![Health badge](/badges/tihloh-prefab-notifications/health.svg)

```
[![Health](https://phpackages.com/badges/tihloh-prefab-notifications/health.svg)](https://phpackages.com/packages/tihloh-prefab-notifications)
```

PHPackages © 2026

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