Download the PHP package dangkien/roleper without Composer

On this page you can find all versions of the php package dangkien/roleper. 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 roleper

RolePermission

Role-Permission Laravel Packget

Installation

1)Just add the following to your composer.json. Then run composer update:

2) Open your config/app.php and add the following to the providers array:

3) In the same config/app.php and add the following to the aliases array:

4) Run the command below to publish the package config file config/roleper.php:

5) If you want to use Middleware (requires Laravel 5.1 or later) you also need to add the following:

to routeMiddleware array in app/Http/Kernel.php.

copy to User.php

Checking for Roles & Permissions

Now we can check for roles and permissions simply by doing:

Both hasRole() and can() can receive an array of roles & permissions to check:

By default, if any of the roles or permissions are present for a user then the method will return true. Passing true as a second parameter instructs the method to require all of the items:

You can have as many Roles as you want for each User and vice versa.

Route

User

Next, use the RolePerUserTrait trait in your existing User model. For example:

php Route::group(['prefix' => 'admin', 'middleware' => ['role:admin']], function() { Route::get('/', 'AdminController@welcome'); Route::get('/manage', ['middleware' => ['permission:manage-admins'], 'uses' => 'AdminController@manageAdmins']); });



It is possible to use pipe symbol as *OR* operator:

To emulate *AND* functionality just use multiple instances of middleware

For more complex situations use `ability` middleware which accepts 3 parameters: roles, permissions, validate_all

All versions of roleper with dependencies

PHP Build Version
Package Version
Requires php Version >=5.5.0
illuminate/console Version ~5.0
illuminate/support Version ~5.0
illuminate/cache Version ~5.0
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 dangkien/roleper contains the following files

Loading the files please wait ....