Download the PHP package panoscape/privileges without Composer

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

Privileges

Privilege and Group control for Laravel

Installation

You can install this package via composer using this command:

Register service provider:

config/app.php

If you need blade directives, also add this:

config/app.php

A middleware can also be registered:

app/Http/Kernel.php

Publish profile config:

Modify the published profile template to suit your application.

config/privileges_profile.php

Add Panoscape\Privileges\Privilege\UserEntity trait to your user model, Panoscape\Privileges\Privilege\GroupEntity trait to your group model, and Panoscape\Privileges\Privilege\PrivilegeEntity trait to your privilege model.

If you have multiple privileges control flow or you prefer a different profile name, you may copy and modify the default profile template and rename it to something else, admin_profile for example. Then defile a method named profile in your related models and set them to the config name of your choice.

Here is an example of Admin, Role, Permission(instead of User,Group,Privilege):

config/admin_profile.php

app/Admin.php

app\Role.php

app\Permission.php

Migration

This package does not provide any migrations or commands. You should create three required models/migrations and two pivot tables by yourself. The minimal requirements of table structures are listed in the profile template.

Basic Usage

Access groups/privileges relationship of a user:

or via dynamic properties:

If you have different entity names other than the default User, Group, Privilege, You should access the relationships by the table values defined in your profile.

Example of Admin, Role, Permission:

Group and Privilege validation

has:

all:

any:

Instead of the default name column checking, you may specify which column to check:

validate:

With this method you can do complex checking

all:

equivalent to

any:

equivalent to

all + any:

equivalent to

group:

equivalent to

privilege:

equivalent to

group + privilege:

equivalent to

Column specification is also available:

Middleware

If you have registered the middleware, you can add it to any routes you'd like to guard with it.

Balde

If you have registered the blade service provider, you may guard your blade codes with @validate , @group and @privilege.

Also your user entity need to implement Panoscape\Privileges\Privileged interface in order to use these blade directives.

Blade directives:

Performance

joined 5 tables(2 of them are pivot tables) within one query:

joined 5 tables(2 of them are pivot tables) within two query:

joined 5 tables(2 of them are pivot tables) within two query:

Conclusion

Each any group costs one query;

All all group costs one query.


All versions of privileges with dependencies

PHP Build Version
Package Version
Requires php Version >=5.6.4
illuminate/support Version ^5.3
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 panoscape/privileges contains the following files

Loading the files please wait ....