Midwestern-Interactive / laravel-permissions-sync

Easy artisan permissions syncing

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Laravel Permissions Sync

Ability to Sync permissions effortlessly, across environments.

Getting Started

Installation

Install via composer

$ composer require 'mwi/laravel-permissions-sync'

Usage

Inside \App\Services make a new file named RolesAndPermissions.php, an example

<?php
namespace App\Services;

class RolesAndPermissions
{
	/**
	 * returns the structure of our roles and permission
	 *
	 * @return array
	 * @author 
	 **/
	public static function structure()
	{
		return [
	        'super admin' => [
	            'view user',
	            'create user',
	            'update user',
	            'delete user',
	        ],
	        'admin' => [
	            'view user',
	        ],
	        'user' => [
	            'view user',
	        ]
	    ];
	}
}

In terminal run

$ php artisan spatie:permissions:sync

This will sync all of your roles and permissions into the database


Flags

Flag Description Default
--clean deletes unused roles and permissions false
--verbosity logs to console, defaults to 1 if on local environment 0

Contributing

Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.

Versioning

We use SemVer for versioning. For the versions available, see the tags on this repository.

Authors

See also the list of contributors who participated in this project.

License

This project is licensed under the MIT License - see the website for details

About

Easy artisan permissions syncing

License:MIT License


Languages

Language:PHP 100.0%