abottarini/laravel-nova-traits

A set of useful Laravel Nova Traits for your Resources

v1.2.3 2023-04-13 08:26 UTC

This package is auto-updated.

Last update: 2024-11-13 12:27:01 UTC


README

This package contains a set of useful Laravel Nova Traits for your Resources.

Installation

composer require abottarini/laravel-nova-traits

Usage

Usage is super simple, just import traits in your Resource and use them.

use AlbertoBottarini\LaravelNovaTraits\HiddenFromNavigation;

class MyResource extends Resource 
{
    use HiddenFromNavigation;
}

Available Traits

  • HiddenFromNavigation: Removes resource from navigation bar
  • Uncreatable: Disables create action for all users
  • Unupdatable: Disables update action for all users
  • Undeletable: Disables delete action for all users
  • Unviewable: Disables view action for all users
  • Unreplicable: Disables replicate action for all users (Nova 4)
  • ReadOnlyResource: Makes resource read-only (is an alias of Uncreatable + Unupdatable + Undeletable)
  • RedirectToViaResource: Redirects user to "via" Resource after creating or updating a child Resource