PHP code example of alphaolomi / laravel-notes

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

    

alphaolomi / laravel-notes example snippets


return [
    'model' => \AlphaOlomi\Notes\Models\Note::class,

    'user' => \App\Models\User::class,

];

use AlphaOlomi\Notes\Concerns\HasNotes;

class Project extends Model
{
    use HasNotes;
}

$project = Project::first();

$project->addNote('This is a note.');

$project->addNote('This ia a another note.', user: User::first());

$project->addNote('Thanks you!', parent: Note::find(2));
bash
php artisan vendor:publish --tag="notes-migrations"
php artisan migrate
bash
php artisan vendor:publish --tag="notes-config"