An open API service indexing awesome lists of open source software.

https://github.com/mission-4/cinnamon-role

Laravel Role Management Package
https://github.com/mission-4/cinnamon-role

cinnamon-role laravel role-manager

Last synced: 5 months ago
JSON representation

Laravel Role Management Package

Awesome Lists containing this project

README

        

# Cinnamon Role - Easy Role management for Laravel 5
[![StyleCI](https://styleci.io/repos/83485720/shield?branch=master)](https://styleci.io/repos/83485720)
[![Packagist](https://img.shields.io/packagist/v/mission4/cinnamon-role.svg?style=flat-square)](https://packagist.org/packages/mission4/cinnamon-role)
[![Packagist](https://img.shields.io/packagist/dt/mission4/cinnamon-role.svg?style=flat-square)](https://packagist.org/packages/mission4/cinnamon-role)

Cinnamon Role is a simple Role management system built for Laravel 5 with a backend Json Api for easy implementation.

## Feature List:
- [x] Permissions List
- [x] Roles list
- [x] Users list
- [x] Add Permissions and Roles
- [x] Connect Roles to Permissions
- [x] Connect Users to Roles
- [x] Create Gates for Permissions
- [x] Add Permissions to the `Can` and `Allows` methods
- [x] Easy Backend UI using ajax with Vue.js 2 components

## Installation
Using Composer:
``` bash
composer require mission4/cinnamon-role
```
Add the `Rolable` trait to the `User` model.
``` php
use \Mission4\CinnamonRole\Traits\Rolable;
```
And register your policies in the **AuthServiceProvider** `boot()` method.
``` php
public function boot()
{
$this->registerPolicies();
// Register CinnamonRole Permissions Policies
CinnamonRole::registerPermissions();
// Don't forget to import the class Mission4\CinnamonRole\CinnamonRole
}
```

## Using the Vue Components For the UI
Using Laravel Mix.
``` bash
# Publish the Vue Components to the resources/assets/js/vendor/cinnamon-role directory
php artisan vendor:publish --tag=cinnamon-role
```
And add the Vue Components to your `app.js` file and then compile your JavaScript.
``` javascript
Vue.component('cinnamon-role-users-table', require('./components/cinnamon-role/CinnamonRoleUsersTable.vue'));
Vue.component('cinnamon-role-permissions-table', require('./components/cinnamon-role/CinnamonRolePermissionsTable.vue'));
Vue.component('cinnamon-role-roles-table', require('./components/cinnamon-role/CinnamonRoleRolesTable.vue'));
```
Add these to your Blade file that you want to edit roles and permissions on.
``` html

```