acr/roles

There is no license information available for the latest version (dev-master) of this package.

:description

dev-master 2019-05-30 09:01 UTC

README

Latest Version on Packagist Total Downloads Build Status

Installation

Via Composer

$ composer require acr/roles
Php Artisan
$ php artisan vendor:publish --provider="acr\roles\rolesServiceProvider"
$ php artisan make:auth
$ php artisan migrate
$ php artisan make:model Role
add config/app.php
acr\roles\rolesServiceProvider::class,
Insert Models User.php
function roles() {
   return $this->belongsToMany('App\Role');
}
controller.php
$acrRolesFilesPathJs = "/vendor/acr/roles/static/js";
$acrRolesFilesPathCss = "/vendor/acr/roles/static/css";
$scannedDirectoryJs = array_diff(scandir($acrRolesFilesPathJs), array('..', '.'));
$scannedDirectoryCss = array_diff(scandir($acrRolesFilesPathCss), array('..', '.'));
layout.blade.php
<html>
    <head>
        <!-- push target to head -->
        @stack('styles')
        @stack('scripts')
    </head>
    <body>
        <!-- or push target to footer -->
        @stack('scripts')
    </body>
</html>
view.blade.php
@push('styles')
   @foreach($scannedDirectoryCss as $file) 
      <link href="{{"/$file"}}" rel="stylesheet">
   @endforeach
@endpush
@push('scripts')
    @foreach($scannedDirectoryJs as $file) 
      <script type="text/javascript" src="{{ "/$file" }}"></script>
    @endforeach
@endpush

Usage

Your link of user page and add roles

 #/acr/roles/user/{{$user_id}}
 #/acr/roles/new

Testing

$ composer test

Security

If you discover any security related issues, please email author email instead of using the issue tracker.

Credits

License

license. Please see the license file for more information.