PHPackages                             digitalcloud/laravel-model-notes - 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. digitalcloud/laravel-model-notes

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

digitalcloud/laravel-model-notes
================================

A package to enable assigning notes to Eloquent Models

v1.1(7y ago)834.3k8[1 issues](https://github.com/DigitalCloud/laravel-model-notes/issues)[1 PRs](https://github.com/DigitalCloud/laravel-model-notes/pulls)2MITPHPPHP ^7.1

Since Jan 20Pushed 4y ago3 watchersCompare

[ Source](https://github.com/DigitalCloud/laravel-model-notes)[ Packagist](https://packagist.org/packages/digitalcloud/laravel-model-notes)[ Docs](https://github.com/digitalcloud/laravel-model-notes)[ RSS](/packages/digitalcloud-laravel-model-notes/feed)WikiDiscussions master Synced 1w ago

READMEChangelog (2)Dependencies (1)Versions (3)Used By (2)

Laravel Model Notes
===================

[](#laravel-model-notes)

This package allows you to add notes to your model.

Description
-----------

[](#description)

Suppose you are working on model, say Invoice model, and this invoice need to pass some management process. Each management state need the manager to add some notes on this invoice, and you need to track all notes for this invoice. This package allow you to do this job just by adding some trait to your model.

Add note to Eloquent models
---------------------------

[](#add-note-to-eloquent-models)

This package provides a `HasNotes` trait that, once installed on a model, allows you to do things like this:

```
// add a note
$model->setNote('New Note Here');

// get all notes
$model->notes();
```

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

[](#installation)

You can install the package via composer:

```
composer require digitalcloud/laravel-model-notes
```

You must publish the migration with:

```
php artisan vendor:publish --provider="DigitalCloud\ModelNotes\ModelNotesServiceProvider" --tag="migrations"
```

Migrate the `notes` table:

```
php artisan migrate
```

Optionally you can publish the config-file with:

```
php artisan vendor:publish --provider="DigitalCloud\ModelNotes\ModelNotesServiceProvider" --tag="config"
```

This is the contents of the file which will be published at `config/models-notes.php`

```
return [

    /*
     * The class name of the note model that holds all notes.
     *
     * The model must be or extend `DigitalCloud\ModelNotes\Note::class`.
     */
    'note_model' => DigitalCloud\ModelNotes\Note::class,

    /*
     * The name of the column which holds the ID of the model related to the notes.
     *
     * You can change this value if you have set a different name in the migration for the notes table.
     */
    'model_primary_key_attribute' => 'model_id',

];
```

Usage
-----

[](#usage)

Add the `HasNotes` trait to a model you like to use notes on.

```
use DigitalCloud\ModelNotes\HasNotes;

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

### add a new note

[](#add-a-new-note)

You can add a new note like this:

```
$model->setNote('new note');
```

### Retrieving notes

[](#retrieving-notes)

you can get all associated notes of a model like this:

```
$allNotes = $model->notes;
```

### Custom model and migration

[](#custom-model-and-migration)

You can change the model used by specifying a class name in the `note_model` key of the `model-notes` config file.

You can change the column name used in the note table (`model_id` by default) when using a custom migration where you changed that. In that case, simply change the `model_primary_key_attribute` key of the `model-notes` config file.

###  Health Score

35

—

LowBetter than 77% of packages

Maintenance18

Infrequent updates — may be unmaintained

Popularity33

Limited adoption so far

Community20

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 71.4% 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 ~2 days

Total

2

Last Release

2764d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/1a11fa4bb6d4362819939f663d222719ef7de81b8029e31bb107826dc38cc1d5?d=identicon)[mohrajab](/maintainers/mohrajab)

![](https://avatars.githubusercontent.com/u/41853913?v=4)[Motaz Marouf](/maintainers/devmtm)[@devmtm](https://github.com/devmtm)

---

Top Contributors

[![devmtm](https://avatars.githubusercontent.com/u/41853913?v=4)](https://github.com/devmtm "devmtm (5 commits)")[![alberto1el](https://avatars.githubusercontent.com/u/597863?v=4)](https://github.com/alberto1el "alberto1el (1 commits)")[![mohrajab](https://avatars.githubusercontent.com/u/17740650?v=4)](https://github.com/mohrajab "mohrajab (1 commits)")

---

Tags

digitalcloudlaravel-note

### Embed Badge

![Health badge](/badges/digitalcloud-laravel-model-notes/health.svg)

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

###  Alternatives

[jdorn/sql-formatter

a PHP SQL highlighting library

3.8k117.8M121](/packages/jdorn-sql-formatter)[backup-manager/backup-manager

A framework agnostic database backup manager with user-definable procedures and support for S3, Dropbox, FTP, SFTP, and more with drivers for popular frameworks.

1.7k1.6M11](/packages/backup-manager-backup-manager)[propel/propel1

Propel is an open-source Object-Relational Mapping (ORM) for PHP5.

8351.6M88](/packages/propel-propel1)[insolita/yii2-migration-generator

Set of gii tools for generating files for migration by schema of table , phpdoc or table data

108508.0k5](/packages/insolita-yii2-migration-generator)[xpdo/xpdo

A PDO-based Object/Relational Bridge Library

7088.4k4](/packages/xpdo-xpdo)[voku/session2db

A PHP library acting as a wrapper for PHP's default session handling functions which stores data in a MySQL database, providing both better performance and better security and protection against session fixation and session hijacking.

2920.0k](/packages/voku-session2db)

PHPackages © 2026

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