Skip to content
This repository has been archived by the owner on Sep 25, 2023. It is now read-only.

Midwestern-Interactive/laravel-permissions-sync

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

Releases

No releases published

Packages

No packages published

Languages