Download the PHP package zjien/quantum without Composer

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

Quantum

Build Status

Quantum是个基于RESTful API的RBAC Laravel扩展包

Contents

安装

1) 在终端输入下面命令: composer require zjien/quantum 然后稍等几分钟。

2) 当composer下载并安装完成后。编辑 config/app.php 文件,添加下面代码到 providers 数组里:

然后添加下列代码到 aliases 数组里:

3) 在终端运行下面命令,复制Quantum的配置文件到你项目的配置目录中。

配置

1) 运行下面命令,生成Quantum的迁移文件。

该命令会生成Quantum的迁移文件到你项目的迁移目录中。

2) 在 config/quantum.php 配置文件设置相应的配置信息。

继承 Quantum 的 Models

Role

创建你自己的 Role 模型(或者直接使用Quantum的),并继承 Quantum 的 Role 模型:

Permission

创建你自己的 Permission 模型(或者直接使用Quantum的),并继承 Quantum 的 Permission 模型:

User

创建你自己的 User 模型(或者直接使用Quantum的),并继承 Quantum 的 User 模型:

接着运行以下命令:

使用

创建角色

创建权限

为角色增添权限

为用户增添角色

判断用户是否拥有某权限

$role = Role::find(1); $user->is($role);//判断用户是否拥有某个角色 $perm = Permission::find(2); $user->can($perm);//判断用户是否有某个权限

iscan 都可以传入一个对象数组 $role = Role::find([1,2]); $user->is($role, true);//要求用户拥有所有角色才有效 $perm = Permission::find([1,2]); $user->can($perm);//判断用户是否有多个权限中的某个

中间件

使用中间验证请求资源的用户是否具有访问该资源的权限 在 app/Http/Kernel.phprouteMiddleware 数组中添加如下代码:


All versions of quantum with dependencies

PHP Build Version
Package Version
Requires php Version >=5.5.9
illuminate/console Version ~5.0
illuminate/support Version ~5.0
illuminate/config Version ~5.0
illuminate/database Version ~5.0
illuminate/filesystem Version ~5.0
symfony/http-kernel Version 2.7.*
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 zjien/quantum contains the following files

Loading the files please wait ....