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

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

othyn/laravel-notes
===================

Assign notes to any model entity with ease.

v1.0.2(3y ago)12832MITPHPPHP ^8.1

Since Jan 19Pushed 3y ago1 watchersCompare

[ Source](https://github.com/othyn/laravel-notes)[ Packagist](https://packagist.org/packages/othyn/laravel-notes)[ Docs](https://github.com/othyn/laravel-notes)[ GitHub Sponsors](https://github.com/othyn)[ RSS](/packages/othyn-laravel-notes/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (3)Dependencies (5)Versions (4)Used By (0)

 [![logo](art/logo.svg)](art/logo.svg)Laravel Notes
=============

[](#laravel-notes)

A centralised note store for any and all model entities. Finally, no longer a need for storing a notes field in each and every table! Ideal for system wide generic comment systems.

 [ ![lint action](https://github.com/othyn/laravel-notes/actions/workflows/00-lint.yml/badge.svg) ](https://github.com/othyn/laravel-notes/actions/workflows/00-lint.yml) [ ![tests action](https://github.com/othyn/laravel-notes/actions/workflows/10-tests.yml/badge.svg) ](https://github.com/othyn/laravel-notes/actions/workflows/10-tests.yml) [ ![coverage](https://camo.githubusercontent.com/89f45d49f11b0a1e547cba3f1ec12c72f7299c19a45df6d877ffbdc68aef7b0f/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5465737420436f7665726167652d3130302532352d677265656e) ](https://github.com/othyn/laravel-notes/actions/workflows/10-tests.yml) [ ![packagist download](https://camo.githubusercontent.com/437a8a982d73f01f54fabc69abfa6fe33c04263b713118034cbc11d57d334ae9/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6f7468796e2f6c61726176656c2d6e6f7465732e7376673f7374796c653d666c6174) ](https://packagist.org/packages/othyn/laravel-notes) [ ![packagist downloads count](https://camo.githubusercontent.com/f2d66b874bc47c730e508fba0f80fe5f8ab34c23db91d5921c049ceb78c6c001/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6f7468796e2f6c61726176656c2d6e6f7465732e7376673f7374796c653d666c6174) ](https://packagist.org/packages/othyn/laravel-notes) [ ![contributors](https://camo.githubusercontent.com/1f51c4785f6db1ba1d23cb9c188499eba87a7781e4a78f6479bac080a9b4f6d9/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f636f6e7472696275746f72732f6f7468796e2f6c61726176656c2d6e6f746573) ](https://github.com/othyn/laravel-notes/graphs/contributors) [ ![forks](https://camo.githubusercontent.com/f9f82bb91c0adac31df8dd9c93648b357809016fd0f1ea9a301918730dc0c713/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f666f726b732f6f7468796e2f6c61726176656c2d6e6f746573) ](https://github.com/othyn/laravel-notes/network/members) [ ![stars](https://camo.githubusercontent.com/423e3dc2fefeeadbb50d9d11f1bd1804b9e57e0759c05d4faf06fa7fc696592b/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f73746172732f6f7468796e2f6c61726176656c2d6e6f746573) ](https://github.com/othyn/laravel-notes/stargazers) [ ![open issues](https://camo.githubusercontent.com/a80c1dbfdb21d8e8671894e3eb86f26e832d869b18941ab2273b7a2fc6370e36/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6973737565732f6f7468796e2f6c61726176656c2d6e6f746573) ](https://github.com/othyn/laravel-notes/issues/) [ ![license](https://camo.githubusercontent.com/54bcdd751912c5d52d92a785c7203190dfb3971939b2da9e91b471a5573ae08d/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f6f7468796e2f6c61726176656c2d6e6f746573) ](https://github.com/othyn/laravel-notes/blob/master/LICENSE)

####  [Install Latest Version](#floppy_disk-install)  ·  [Report Bug](https://github.com/othyn/laravel-notes/issues/new?assignees=&labels=bug&template=bug.yml)  ·  [Request Feature](https://github.com/othyn/laravel-notes/issues/new?assignees=&labels=enhancement&template=enhancement.yml)

[](#--------install-latest-version------------------report-bug------------------request-feature----)

📔 Table of Contents
-------------------

[](#notebook_with_decorative_cover-table-of-contents)

- [About the Project](#star2-about-the-project)
    - [Tech Stack](#space_invader-tech-stack)
    - [Features](#dart-features)
- [Install](#floppy_disk-install)
    - [Version Matrix](#version-matrix)
- [Usage](#hammer_and_wrench-usage)
    - [Configuration](#wrench-configuration)
    - [Models](#elephant-models)
- [Contributing](#bread-contributing)
    - [Project Tooling Quick Reference](#toolbox-project-tooling-quick-reference)
- [Changelog](https://github.com/othyn/laravel-notes/releases)
- [License](#warning-license)
- [Acknowledgements](#gem-acknowledgements)

🌟 About the Project
-------------------

[](#star2-about-the-project)

On a recent personal project, I was finding that I was utilising a `notes` field against practically all tables, with the functionality also shared. The idea being that the user could quickly leave notes against any entity in the system, in which centralising that saves a load of overhead in each table and repeat code. I also make use of a shared [Livewire table](https://github.com/rappasoft/laravel-livewire-tables) that automatically loads [Audit's](https://github.com/owen-it/laravel-auditing) (in which the awesome design of that package inspired this one) for a given Entity when viewing it. The table is automatically injected into the rendered view determined automatically by the URL slug, which was a perfect use case to replicate for the `notes` system, thus this library was born.

### 👾 Tech Stack

[](#space_invader-tech-stack)

- Language: [PHP](https://www.php.net/)
- Dependency Manager: [Composer](https://getcomposer.org/)
- Framework: [Laravel](https://laravel.com/)
- Package: [illuminate/support](https://github.com/illuminate/support)
- Package: [orchestra/testbench](https://github.com/orchestra/testbench)
- Package: [pestphp/pest](https://github.com/pestphp/pest)
- Package: [phpunit/phpunit](https://github.com/phpunit/phpunit)
- Package: [friendsofphp/php-cs-fixer](https://github.com/friendsofphp/php-cs-fixer)

### 🎯 Features

[](#dart-features)

- Centralised note store against any Model entity
- Saves replicating repetitive fields and functionality across many tables
- Quickly apply the functionality to any Model with an interface and trait combo
- Easily overridable User resolver for custom auth scenarios
- Highly customisable and overridable
- Up and running in minutes

Future addition ideas to play around with:

- Some form of automated (customisable) injectable component for Blade and/or Livewire with backed CRUD functionality.
- Expanding this out to quickly capture *any* set of recurring fields out across all tables with ease, could be an interesting project enhancement

💾 Install
---------

[](#floppy_disk-install)

Installation can be done via [Composer](https://getcomposer.org/):

```
composer require othyn/laravel-notes
```

Then publish the configuration file and migration(s) into your application scope via:

```
# Config
php artisan vendor:publish \
    --provider="Othyn\\LaravelNotes\\LaravelNotesServiceProvider" \
    --tag="config"

# Migrations
php artisan vendor:publish \
    --provider="Othyn\\LaravelNotes\\LaravelNotesServiceProvider" \
    --tag="migrations"
```

Remember to check the default configuration aligns with your requirements (amending if necessary) and **run your migrations to generate the new `notes` table!**

Next you are going to want to head down to the [configuration](#wrench-configuration), so lets get started on [usage](#hammer_and_wrench-usage)! See you there.

### Version Matrix

[](#version-matrix)

Here is the current version matrix for project supported versions of used frameworks and libraries.

Notes VersionPHP VersionLaravel Version`1.0.0``^8.1``^9.0`If you require support for an older version of Laravel, submit an issue as we may be able to look into dropping the version requirements down, as I don't think it needs to be this new. Or, feel free to submit a PR!

🛠️ Usage
--------

[](#hammer_and_wrench-usage)

Laravel Notes is simple in its implementation, to get started all you need to do is add the relevant interface and trait combo the Model you wish to store notes against.

### 🐘 Models

[](#elephant-models)

So, you want to use Laravel Notes eh? I like you, lets get cooking. All you need to do is add the relevant interface and trait combo the Model you wish to store notes against:

```
