Download the PHP package ferdiunal/nova-shield without Composer
On this page you can find all versions of the php package ferdiunal/nova-shield. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download ferdiunal/nova-shield
More information about ferdiunal/nova-shield
Files in ferdiunal/nova-shield
Package nova-shield
Short Description A Laravel Nova package to manage permissions and roles.
License MIT
Informations about the package nova-shield
Nova Shield - WIP
Nova Shield simplifies permission management for your Laravel Nova resources using Spatie Permission. Easily grant or revoke access to specific resources and actions, streamlining your workflow and improving security.
Installation
Configuration
Optionally, you can publish the configuration file using this command:
In the config file, you can control resource permissions by specifying the resources parameter with either the path to the Nova resources folder or a string class path.
For example, in the code below, we define the resources and their corresponding policies:
Custom Menu Configuration
The main purpose of the package was to manage permissions for Nova Resources, but I realized there was a need for Custom Menu support as well. The necessary development has been completed. You can refer to the usage below for implementing Custom Menus.
Then edit App\Nova\Resource.php
file as follows.
Teams Support
I assume you have done the Teams integration for Spatie Permission and you can follow the setup below for NovaShield.
Model Integrations
Teams feature differs in each project, please fill in the relevant method according to your project.
Add Team Field
Considering that the Teams feature will differ in each project, you need to add the team field yourself.
Add Middleware to Nova Routes
Add TeamMiddleware to nova routes
ScreenShots
License This package is open-sourced software licensed under the MIT license.
All versions of nova-shield with dependencies
laravel/framework Version ^11.0
laravel/nova Version ^4.0
spatie/laravel-permission Version ^6.9