PHPackages                             centrex/laravel-model-note - 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. [Database &amp; ORM](/categories/database)
4. /
5. centrex/laravel-model-note

ActiveLibrary[Database &amp; ORM](/categories/database)

centrex/laravel-model-note
==========================

This package add note to eloquent model

v1.3.3(8mo ago)12.4kMITPHPPHP ^8.2|^8.3|^8.4CI passing

Since Jun 2Pushed 2mo agoCompare

[ Source](https://github.com/centrex/laravel-model-note)[ Packagist](https://packagist.org/packages/centrex/laravel-model-note)[ Docs](https://github.com/centrex/laravel-model-note)[ RSS](/packages/centrex-laravel-model-note/feed)WikiDiscussions main Synced today

READMEChangelogDependencies (14)Versions (20)Used By (0)

Add notes to any Eloquent model
===============================

[](#add-notes-to-any-eloquent-model)

[![Latest Version on Packagist](https://camo.githubusercontent.com/0a926f96b99757697533ad9e05483c9beee2911e83eaf903ab305da047a458ef/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f63656e747265782f6c61726176656c2d6d6f64656c2d6e6f74652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/centrex/laravel-model-note)[![GitHub Tests Action Status](https://camo.githubusercontent.com/6d800d2123f405741f192f81b3c7f388c6c9adac31d6fc9bdf059951c4124204/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f63656e747265782f6c61726176656c2d6d6f64656c2d6e6f74652f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/centrex/laravel-model-note/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/629ed617b0326f522797f7a812f1f5a82480ea3dd0e48876294cc7c729928d87/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f63656e747265782f6c61726176656c2d6d6f64656c2d6e6f74652f6669782d7068702d636f64652d7374796c652d6973737565732e796d6c3f6272616e63683d6d61696e266c6162656c3d636f64652532307374796c65267374796c653d666c61742d737175617265)](https://github.com/centrex/laravel-model-note/actions?query=workflow%3A%22Fix+PHP+code+style+issues%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/7fe74e624f61c345235ea512933f2b8af307c9d4d9a5f8cbf8694f3c253215dc/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f63656e747265782f6c61726176656c2d6d6f64656c2d6e6f74653f7374796c653d666c61742d737175617265)](https://packagist.org/packages/centrex/laravel-model-note)

Attach polymorphic notes to any Eloquent model with support for tagging, privacy control, and bulk operations. Notes are stored in a `model_notes` table and ordered newest-first by default.

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

[](#installation)

```
composer require centrex/laravel-model-note
php artisan vendor:publish --tag="laravel-model-note-migrations"
php artisan migrate
```

Usage
-----

[](#usage)

### 1. Add the trait

[](#1-add-the-trait)

```
use Centrex\LaravelModelNote\HasNotes;

class Order extends Model
{
    use HasNotes;
}
```

### 2. Add notes

[](#2-add-notes)

```
$order->addNote('Payment confirmed by finance.');

// Private note (not shown to customers)
$order->addPrivateNote('Suspicious address — flag for review.');

// Tagged note
$order->addNote('Dispatched via DHL.', tag: 'shipping');
$order->addNote('Customer called in.', isPrivate: true, tag: 'support');
```

### 3. Read notes

[](#3-read-notes)

```
// Latest note content (shortcut)
echo $order->note();

// Latest note object, optionally filtered by tag
$note = $order->lastNote('shipping');
echo $note->time_ago;  // "2 hours ago"

// All notes
$order->allNotes();
$order->allNotes('support');   // filtered by tag

// Private notes only
$order->privateNotes();
$order->privateNotes('shipping');
```

### 4. Delete notes

[](#4-delete-notes)

```
$order->deleteNote(5);
$order->deleteNote([5, 6, 7]);
$order->deleteNoteByTag('shipping');
$order->deleteAllNotes();
```

### 5. Query scopes on ModelNote

[](#5-query-scopes-on-modelnote)

```
use Centrex\LaravelModelNote\ModelNote;

ModelNote::private()->get();
ModelNote::public()->get();
ModelNote::withTag('support')->get();
```

### ModelNote attributes

[](#modelnote-attributes)

AttributeTypeDescription`note``string`Note content`tag``string|null`Optional category tag`is_private``bool`Hidden from non-admin views`user_id``int|null`Author (defaults to `auth()->id()`)`time_ago``string`Human-readable age (`diffForHumans()`)Testing
-------

[](#testing)

```
composer test        # full suite
composer test:unit   # pest only
composer test:types  # phpstan
composer lint        # pint
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Credits
-------

[](#credits)

- [centrex](https://github.com/centrex)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE) for more information.

###  Health Score

45

—

FairBetter than 91% of packages

Maintenance75

Regular maintenance activity

Popularity17

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity67

Established project with proven stability

 Bus Factor1

Top contributor holds 66.7% 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 ~38 days

Total

14

Last Release

268d ago

Major Versions

v0.0.2 → v1.0.02024-06-02

PHP version history (2 changes)v0.0.1PHP ^8.1|^8.2

v1.1.0PHP ^8.2|^8.3|^8.4

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/29769944?v=4)[Raisul Islam](/maintainers/rochi88)[@rochi88](https://github.com/rochi88)

---

Top Contributors

[![rochi88](https://avatars.githubusercontent.com/u/29769944?v=4)](https://github.com/rochi88 "rochi88 (42 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (14 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (7 commits)")

---

Tags

laravelcentrexlaravel-model-note

###  Code Quality

TestsPest

Static AnalysisPHPStan, Rector

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/centrex-laravel-model-note/health.svg)

```
[![Health](https://phpackages.com/badges/centrex-laravel-model-note/health.svg)](https://phpackages.com/packages/centrex-laravel-model-note)
```

###  Alternatives

[spatie/laravel-medialibrary

Associate files with Eloquent models

6.1k43.2M631](/packages/spatie-laravel-medialibrary)[mongodb/laravel-mongodb

A MongoDB based Eloquent model and Query builder for Laravel

7.1k8.4M96](/packages/mongodb-laravel-mongodb)[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M346](/packages/psalm-plugin-laravel)[yajra/laravel-oci8

Oracle DB driver for Laravel via OCI8

8793.2M25](/packages/yajra-laravel-oci8)[kirschbaum-development/eloquent-power-joins

The Laravel magic applied to joins.

1.6k32.6M46](/packages/kirschbaum-development-eloquent-power-joins)[glushkovds/phpclickhouse-laravel

Adapter of the most popular library https://github.com/smi2/phpClickHouse to Laravel

2051.5M2](/packages/glushkovds-phpclickhouse-laravel)

PHPackages © 2026

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