Laravel Community Tools by Tighten
Laravel Nova icon Nova Packages
N

Attach Many (with ajax autocomplete)

Readme

Nova Attach Many

Latest Version on Github Total Downloads

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

attach-many

Installation

composer require laravelrotebal/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)

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

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)
Back to Top
Added 6 years ago
Last updated 6 Years Ago
Version 2.0.0
Composer
laravelrotebal/nova-attach-many
GitHub stars 5
Packagist downloads 16,901

Favorites

7 users favorited

Rating

5.00
(out of 5)
★★★★★
★★★★
★★★
★★
2 ratings

Author

Tags

Brought to you by Tighten

Issues/Feature Requests Stats Package Ideas