PHP code example of digitalcloud / nova-resource-notes

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

    

digitalcloud / nova-resource-notes example snippets


use DigitalCloud\ModelNotes\HasNotes;

class YourEloquentModel extends Model
{
    use HasNotes;
}



namespace App\Nova;

use DigitalCloud\NovaResourceNotes\Fields\Notes;
use Illuminate\Http\Request;

class YourResource extends Resource {
    
    // ...
    
    public static $model = 'YourEloquentModel'; // model must use `HasNotes` trait`
    
    public function fields(Request $request)
    {
        return [
            // ...
            // This will appear in the resource detail view.
            Notes::make('Notes','notes'),
            // ...
        ];
    }
    
    // ...

}