1. Go to this page and download the library: Download centrex/laravel-model-note library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
centrex / laravel-model-note example snippets
use Centrex\LaravelModelNote\HasNotes;
class YourEloquentModel extends Model
{
use HasNotes;
}
$model->addNote('whatever you like');
$model->addNote('whatever you like' , true);
//or alternatively
$model->addPrivateNote('whatever you like');
$model->addNote('whatever you like' , false , "tag1");
//or for the private note
$model->addPrivateNote('whatever you like' , "tag2");
$model->note; // returns the text of the last note
$model->note(); // returns the last instance of `Centrex\LaravelModelNote\ModelNote`
//or alternatively
$model->lastNote(); // returns the last instance of `Centrex\LaravelModelNote\ModelNote`
//last note of specific tag
$last_note = $model->lastNote("tag1");
//specific tag
$all_notes = $model->allNotes("tag1");
//specific tags
$all_notes = $model->allNotes("tag1" , "tag2");