dillingham/nova-attach-many

Attach Many Nova field

Installs: 192 885

Dependents: 2

Suggesters: 0

Security: 0

Stars: 146

Watchers: 6

Forks: 46

Open Issues: 28

Language:Vue

1.0.11 2019-03-22 13:17 UTC

This package is auto-updated.

Last update: 2020-10-10 14:28:51 UTC


README

Latest Version on Github Total Downloads Twitter Follow

Belongs To Many create & edit form UI for Nova. Enables attaching relationships easily and includes validation.

attach-many

Installation

composer require dillingham/nova-attach-many

Usage

use NovaAttachMany\AttachMany;
public function fields(Request $request)
{
    return [
        AttachMany::make('Permissions'),
    ];
}

Validation

You can set min, max, size or custom rule objects

->rules('min:5', 'max:10', 'size:10', new CustomRule)

52160802-9ee9ac80-2689-11e9-9657-80e3c0d83b27.png

Options

Here are a few customization options

  • ->showCounts() Shows "selected/total"
  • ->showPreview() Shows only selected
  • ->hideToolbar() Removes search & select all
  • ->height('500px') Set custom height
  • ->fullWidth() Set to full width
  • ->help('<b>Tip:</b> help text') Set the help text

All Options Demo

53781117-6978ee80-3ed5-11e9-8da4-d2f2408f1ffb.png

Relatable

The attachable resources will be filtered by relatableQuery() So you can filter which resources are able to be attached

Authorization

This field also respects policies: ie Role / Permission

  • RolePolicy: attachAnyPermission($user, $role)
  • RolePolicy: attachPermission($user, $role, $permission)
  • PermissionPolicy: viewAny($user)

Author

Hi 👋, Im Brian D. I created this Nova package and others

Hope you find it useful. Feel free to reach out with feedback.

Follow me on twitter: @im_brian_d