elijahcruz/laranotes

A simple package to allow you to create notes.

dev-master 2022-07-04 22:39 UTC

This package is auto-updated.

Last update: 2024-05-05 02:33:12 UTC


README

Latest Version on Packagist Total Downloads GitHub Actions

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.