Skip to content

bsormagec/nova-resource-notes

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Nova Resource Notes

This package provides a Notes field, which allow you to add and view notes for nova resource.

Installation

You can install the package via composer:

composer require digitalcloud/nova-resource-notes

Note that, this package depend on digitalcloud/laravel-model-notes (https://github.com/DigitalCloud/laravel-model-notes), so you need to configure it before start using this package.

You must add HasNotes trait to the resource model.

use DigitalCloud\ModelNotes\HasNotes;

class YourEloquentModel extends Model
{
    use HasNotes;
}

Usage

In your nova resource add the Notes field:

<?php

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'),
            // ...
        ];
    }
    
    // ...

}

Then, in resource detail page, you can add and delete notes for your resuorce as in the next image.

Images

notes new ui

About

This package allow you to add and view notes for nova resource

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Vue 86.6%
  • PHP 9.7%
  • HTML 1.9%
  • JavaScript 1.8%