Download the PHP package rumspeed/laravel-notes without Composer
On this page you can find all versions of the php package rumspeed/laravel-notes. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download rumspeed/laravel-notes
More information about rumspeed/laravel-notes
Files in rumspeed/laravel-notes
Package laravel-notes
Short Description Add notes to your Eloquent models
License MIT
Homepage https://github.com/rumspeed/laravel-notes
Informations about the package laravel-notes
Laravel Notes
Easily add notes to your Eloquent models.
Installation
You can install the package via composer:
You can publish and run the migrations with:
You can publish the config file with:
This is the contents of the published config file:
Usage
First things first, edit your eloquent model by using the Rumspeed\LaravelNotes\Traits\HasManyNotes
trait.
You can also use the Rumspeed\LaravelNotes\Traits\HasOneNote
trait if you want to manage one note for your model.
Add a note to a model.
You can call the createNote()
method on your Eloquent model like below:
Add With a Author/ User
You can also specify how you want to add the author
id by using the getCurrentAuthorId()
:
Getting Notes
NOTE :
$post->notes
relation property is only available in theHasManyNotes
trait. If you're usingHasOneNote
trait, use$post->note
instead.
Getting the author's notes
You can also retrieve all the author's notes by using the Rumspeed\LaravelNotes\Traits\AuthoredNotes
Trait in your User model (for example).
Finding a note with a specific ID
NOTE : The
findNote()
method is only available in theHasManyNotes
trait.
Testing
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
- Scot Rumery
- All Contributors
License
The MIT License (MIT). Please see License File for more information.
All versions of laravel-notes with dependencies
spatie/laravel-package-tools Version ^1.16
illuminate/contracts Version ^10.0||^11.0