elijahcruz / laranotes
A simple package to allow you to create notes.
Requires
- php: ^7.4|^8.0
- illuminate/support: ^8.0
Requires (Dev)
- orchestra/testbench: ^6.0
- phpunit/phpunit: ^9.0
This package is auto-updated.
Last update: 2024-11-05 03:37:25 UTC
README
This is where your description should go. Try and limit it to a paragraph or two, and maybe throw in a mention of what PSRs you support to avoid any confusion with users and contributors.
Installation
You can install the package via composer:
composer require elijahcruz/laranote
Usage
First you need to public the migration file:
php artisan vendor:publish --tag=laranotes-migrations
Then you can run the migration:
php artisan migrate
The you can add the HasNotes
trait to any model that you want to use notes:
<?php use Illuminate\Database\Eloquent\Model; use Elijahcruz\Laranote\HasNotes class User extends Model { use HasNotes; }
Now you can create, get, update, and delete the notes using the following methods:
$user->notes()->get(); $user->note(1)->first(); $user->createNote('Title', 'Body'); $user->updateNote(1, 'This is an updated note', 'This is the updated body'); $user->deleteNote(1);
For the create and update notes, the note is
Changelog
Please see CHANGELOG for more information what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security
If you discover any security related issues, please email elijah@ec-ws.com instead of using the issue tracker.
Credits
License
The MIT License (MIT). Please see License File for more information.