entrust 安装
详情见github的加粗文字
Zizaco/entrust
Concepts
Let's start by creating the following Roles and Permissions:
$owner = new Role();
$owner->name = 'owner';
$owner->display_name = 'Project Owner'; // optional
$owner->description = 'User is the owner of a given project'; // optional
$owner->save();
$admin = new Role();
$admin->name = 'admin';
$admin->display_name = 'User Administrator'; // optional
$admin->description = 'User is allowed to manage and edit other users'; // optional
$admin->save();
这个角色是在怎么建啊?
Zizaco/entrust
Concepts
Let's start by creating the following Roles and Permissions:
$owner = new Role();
$owner->name = 'owner';
$owner->display_name = 'Project Owner'; // optional
$owner->description = 'User is the owner of a given project'; // optional
$owner->save();
$admin = new Role();
$admin->name = 'admin';
$admin->display_name = 'User Administrator'; // optional
$admin->description = 'User is allowed to manage and edit other users'; // optional
$admin->save();
这个角色是在怎么建啊?
1 个回复
jack
赞同来自:
这样就可以执行上面的php代码了。有可能出现找不到类,需先use 命名空间