Skip to main content

Note

This module adds the ResourceNotes card. This will allow users to add notes to your resource.

Installation

To install this module

composer require qore/notes
php artisan vendor:publish --tag=qore.notes.db
php artisan vendor:publish --tag=qore.notes.frontend

Usage

Make sure to migrate, and create a policy that looks like this:

class NotePolicy
{
use HandlesAuthorization;

public function viewAny(User $user): bool
{
return $user->canViewAny('notes');
}

public function view(User $user, Note $model): bool
{
return $user->canView('notes', $model);
}

public function create(User $user): bool
{
return $user->canCreate('notes');
}

public function update(User $user, Note $model): bool
{
return $user->canUpdate('notes', $model);
}

public function delete(User $user, Note $model): bool
{
return $user->canDelete('notes', $model);
}
}

And register the policy in your AuthServiceProvider:

   protected $policies = [
// ..
Note::class => NotePolicy::class
];

To use this module

Add cards to your resource:

public function cards(): CardCollection
{
return new CardCollection(
(new ResourceNotes())
);
}

Upgrade Guide

To upgrade this module

composer update qore/notes

If you need to upgrade migrations or Vue components:

php artisan vendor:publish --tag=qore.notes.db --force
php artisan vendor:publish --tag=qore.notes.frontend --force

Release notes

All notable changes will be documented here.


0.8.3 (Nov 08, 2021)

Features
  • Add initial release