Download the PHP package marshmallow/nova-user-groups without Composer
On this page you can find all versions of the php package marshmallow/nova-user-groups. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download marshmallow/nova-user-groups
More information about marshmallow/nova-user-groups
Files in marshmallow/nova-user-groups
Package nova-user-groups
Short Description A package to manage Nova User Groups in Nova
License MIT
Homepage https://github.com/marshmallow/nova-user-groups
Informations about the package nova-user-groups
A package to manage Nova User Groups in Nova
A package to manage Nova User Groups in Nova
Installation
You can install the package via composer:
You can publish and run the migrations with:
Usage
Run the install command to start using this package. When you run install, this will create Nova resources so you can manage all the data in your Nova installation. It will also create an administrator user group and connect all the current Nova Resources to that group. It will also connect all existing users to this administrator group.
To add an super administrator group use the -s option
User model
Add the HasUserGroup
trait to you user model.
Nova Resource
Add the UserGroupResource
trait to your main Nova Resource.
User methods
You can add methods to the user model and manage if there allowed to run these methods in Nova. Out of the box we will add three methods to the User model. These are viewNova()
, viewTelescope()
and viewHorizon()
. If you wish to add a new methods to this, you need to follow the following steps.
In your config, add the method that you are going to add.
Next you will need to add the methods to your user model. And call the allowedToRunMethod
method.
Once this is all set up, go to Nova and edit your user group. In the methods section, you will now see you new impersonate
method. Check this to activate this method for that user group.
Nova Service Provider
Add the UserGroupNovaServiceProvider
trait to your NovaServiceProvider
. Once you have done so, you will have a couple of new methods to make sure the authenticated user group is allowed to do stuff that is defined in the NovaServiceProvider.
Change the models and resource
All models and resources can be overruled by changing them in you AppServiceProvider
in the boot
method. You can find an example below. The values in this example are the default values.
Config
Some methods require additional Policy access, add a group under 'groups' with the key and name. Add the allowed methods under 'methods' with group key and the method name.
`bash php artisan user-groups:policies php artisan user-groups:policy {name} php artisan user-groups:import-resources
php artisan marshmallow:resource NovaTool NovaUserGroups --force php artisan marshmallow:resource UserGroup NovaUserGroups --force php artisan marshmallow:resource NovaResource NovaUserGroups --force php artisan marshmallow:resource NovaResourceAction NovaUserGroups --force bash composer test
## Changelog
Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.
## Contributing
Please see [CONTRIBUTING](.github/CONTRIBUTING.md) for details.
## Security Vulnerabilities
Please review [our security policy](../../security/policy) on how to report security vulnerabilities.
## Credits
- [Stef van Esch](https://github.com/marshmallow-packages)
- [All Contributors](../../contributors)
## License
The MIT License (MIT). Please see [License File](LICENSE.md) for more information.
All versions of nova-user-groups with dependencies
spatie/laravel-package-tools Version ^1.11.3
illuminate/contracts Version ^8.0|^9.0|^10.0
marshmallow/nova-tabs Version ^2.0
laravel/nova Version ^4.0