PHPackages                             gmory/laranotes - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. gmory/laranotes

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

gmory/laranotes
===============

A package to attach notes to your models.

2.0.1(8y ago)127MITPHP

Since May 23Pushed 8y ago1 watchersCompare

[ Source](https://github.com/GMory/laranotes)[ Packagist](https://packagist.org/packages/gmory/laranotes)[ RSS](/packages/gmory-laranotes/feed)WikiDiscussions master Synced 4w ago

READMEChangelog (2)Dependencies (4)Versions (7)Used By (0)

LaraNotes
=========

[](#laranotes)

[![Travis](https://camo.githubusercontent.com/fca24b9bdf32ca47dc2d6a0ff2a8c0b3ce1df519a258c48c1e53ebbf3caf3e35/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f474d6f72792f4c6172614e6f7465732e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/GMory/LaraNotes)[![Codecov](https://camo.githubusercontent.com/a13c4308b4cffa18e25b49a7e4018a9348faef3bd62145032a26b9e3a7f8c578/68747470733a2f2f696d672e736869656c64732e696f2f636f6465636f762f632f6769746875622f474d6f72792f6c6172616e6f7465732e7376673f7374796c653d666c61742d737175617265)](https://codecov.io/gh/GMory/laranotes)

A package for laravel that allows you to attach notes to any model of your choosing. This is particularly helpful when you want to add a snippet of information to any of your models.

Use Cases
---------

[](#use-cases)

Some use cases include:

- Noting models with readable messages related to exceptions.
- Noting user log-on/off times.
- Noting an article with the last user to edit it.

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

[](#installation)

Use Composer to install the package.

1. You can do this by running:

```
composer require gmory/laranotes

```

2. Add the service provider to your `config/app.php` file:

```
'providers' => [
    ...
    Gmory\Laranotes\LaranotesServiceProvider::class,
];

```

3. Add the Facade to your `config/app.php` file:

```
'Laranote' => Gmory\Laranotes\LaranotesFacade::class,

```

Usage
-----

[](#usage)

### Setup Relationships with NotesTrait

[](#setup-relationships-with-notestrait)

First place the `NotesTrait` on each of the models you wish to attach notes to. This will give those models the appropriate relationships to access their notes.

### Adding Notes

[](#adding-notes)

To add a note, specify what model you want the note attached to by using `attach($model)`, followed by the `note($content, [$unique])` method:

```
Laranote::attach($user)->note('This user is great!');

```

You can specify to only add the note if it's unique (ensuring that you don't add a duplicate identical note) by passing true as the second argument in the `note()` method.

```
Laranote::attach($user)->note('If this note already exists, do not attach it again.', true);

```

You can make a note regard a secondary model with `regarding($model)`. This is useful when you want a note attached to a particular model, but you want to know what the note is referencing.

```
Laranote::attach($user)->regarding($post)->note($user->name . ' edited this post.');

```

### Deleting Notes

[](#deleting-notes)

You can delete all old notes associated with a model when creating a new note with `deleteOld([$attachedToModel], [$regardingModel], [$onlyThoseBelongingToBoth], [$content])`.

You must include either an `$attachedToModel` or a `$regardingModel` for this function to delete any notes.

You can further expand on the deleting capability by signifying that you only want to delete notes with both the `$attachedTo` model and the `$regardingModel`, and/or by specifying the exact `$content` of the notes you want to delete.

Delete all notes attached to `$user`

```
Laranote::deleteOld($user);

```

Delete all notes regarding `$post`

```
Laranote::deleteOld(null, $post));

```

Delete all notes attached to `$user` and all notes regarding `$post`

```
Laranote::deleteOld($user, $post));

```

Delete only notes both attached to `$user` and regarding `$post`

```
Laranote::deleteOld($user, $post, true));

```

Delete only notes both attached to `$user` and regarding `$post` that have a content of 'User authored a new post'

```
Laranote::deleteOld($user, $post, true, 'User authored a new post'));

```

### Retrieving Notes

[](#retrieving-notes)

To retrieve notes from a particular model, you can call the `notes()` relationship that the `NotesTrait` granted it.

```
$user->notes

```

To retrieve any notes that are regarding a particular model, you can call the `regardedBy()` relationship that the `NotesTrait` granted it.

```
$user->regardedBy

```

### Note Properties

[](#note-properties)

To return a note's content, call the `content` attribute

```
$note->content

```

To return the model the note is attached to, use the `noting` relationship

```
$note->noting

```

To return the model the note is regarding, use the `regarding` relationship

```
$note->regarding

```

License
-------

[](#license)

MIT

###  Health Score

29

—

LowBetter than 57% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity67

Established project with proven stability

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

Total

5

Last Release

3137d ago

Major Versions

1.1.1 → 2.0.02017-05-25

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/17969875?v=4)[Alex Gomory](/maintainers/GMory)[@GMory](https://github.com/GMory)

---

Top Contributors

[![GMory](https://avatars.githubusercontent.com/u/17969875?v=4)](https://github.com/GMory "GMory (5 commits)")

---

Tags

laravelnoteslaravelnotes

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/gmory-laranotes/health.svg)

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

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M337](/packages/psalm-plugin-laravel)[renatomarinho/laravel-page-speed

Laravel Page Speed

2.5k1.7M11](/packages/renatomarinho-laravel-page-speed)[vinkius-labs/laravel-page-speed

Laravel Page Speed

2.5k9.6k1](/packages/vinkius-labs-laravel-page-speed)[webwizo/laravel-shortcodes

Wordpress like shortcodes for Laravel 11, 12 and 13

223700.9k8](/packages/webwizo-laravel-shortcodes)[emargareten/inertia-modal

Inertia Modal is a Laravel package that lets you implement backend-driven modal dialogs for Inertia apps.

90142.9k](/packages/emargareten-inertia-modal)[erag/laravel-pwa

A simple and easy-to-use PWA (Progressive Web App) package for Laravel applications.

177124.1k](/packages/erag-laravel-pwa)

PHPackages © 2026

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