PHP code example of vuer / notes

1. Go to this page and download the library: Download vuer/notes 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/ */

    

vuer / notes example snippets

 php
// config/app.php
'providers' => [
    ...
    Vuer\Notes\NotesServiceProvider::class,
];

php artisan vendor:publish

php artisan migrate
 php
$note = $user->createNote(['body' => 'Lorem ipsum...'], \Auth::user());
 php


namespace App;

use Illuminate\Foundation\Auth\User as Authenticatable;
use Vuer\Notes\Traits\HasNotes;

class User extends Authenticatable
{
    use HasNotes;

    public function getNotesAuthorName()
    {
        return trim(sprintf('%s %s', $this->name, $this->surname));
    }
}
 php
$notes = $user->notes;
$note = $user->note;
 php
  protected $fillable = [
    'description',
  ];

  public function setDescriptionAttribute($value)
  {
      $this->updateOrCreateNote([], ['body' => $value]);
  }

  public function getDescriptionAttribute()
  {
      return $this->note ? $this->note->body : '';
  }