Download the PHP package sweet1s/moonshine-roles-permissions without Composer

On this page you can find all versions of the php package sweet1s/moonshine-roles-permissions. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package moonshine-roles-permissions

MoonShine Roles-Permissions

Description

This package is an extension exclusively designed for the MoonShine Admin Panel, building upon the functionality of the Spatie Laravel Permissions package. The primary purpose of this extension is to streamline role-based access control (RBAC) within the MoonShine Admin Panel. By utilizing this package, you can efficiently assign permissions to roles and then grant those roles to users, simplifying the process of managing permissions on a role-based level rather than individually assigning them to each user.

Total Downloads Latest Stable Version License

Laravel 9+ PHP 8+ Moonshine Admin Panel


Requirements

Moonshine: v2.0+

Spatie Laravel Permissions: v6.0+


Features


Important

Before using the package, it is crucial to understand that you need to use a different user model instead of "MoonShineUser" and use the table users. The package requires the utilization of the Spatie Laravel.


Installation

  1. Install the Spatie Laravel Permissions package and follow the instructions in the documentation to set up the package correctly.

  2. Install the package via composer:

  3. In the MoonShine config file, change the user model to the default User model or the model you want to use for the admin panel.

  4. In the Spatie permission config file, change the models.role to App\Models\Role::class (Model need extend \Spatie\Permission\Models\Role), like this:

  5. For your Role model, add the following:

  6. For the user model, add the following:

  7. Run the following command to install the package and follow the installation steps:

  8. (Optional) Create a user with new modal and assign automatically the role "Super Admin" to it.

  9. Add to your RoleResource trait WithPermissionsFormComponent:

Add to your UserResource trait WithRoleFormComponent:


Or add new MoonShine resource to your MoonShineServiceProvider file, like this (you can use other UserResource):


Dynamic Items on Menu

If you want to add dynamic items to the menu that depend on the role right, you just need to add an array of menus to the MenuRBAC::menu() adapter.


Usage

  1. Creating a section in the admin panel with MoonShine

You can use the following command to generate a resource and permissions at the same time:

  1. For Resource, add the following:

Custom Permissions

If you want to create custom permissions, you can use the following command:

or in PermissionResource


Localization

The package comes with default translation files in English, Russian and Romanian. If you want to customise the translations, you can publish the package translation files in your project using the following command:


Commands documentation


How does it look in the Admin Panel ?

Role Resource User Resource

All versions of moonshine-roles-permissions with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1|^8.2|^8.3
ext-curl Version *
ext-json Version *
lee-to/laravel-package-command Version ^0.9.1
spatie/laravel-permission Version ^6.2
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package sweet1s/moonshine-roles-permissions contains the following files

Loading the files please wait ....