shawnsandy/dash-auth
Composer 安装命令:
composer require shawnsandy/dash-auth
包简介
Dash auth
关键字:
README 文档
README
Dash Auth is simple way to create & manage Bouncer Roles & Abilities.
Install
Via Composer
"repositories": [ { "type": "vcs", "url": "https://github.com/shawnsandy/dash-auth" } ],
- Add the package to your
composer.jsonfile as VCS repository, sorry there is no packagist install just yet.
$ composer require shawnsandy/dash-auth
- From the command prompt run the above to install the package
Usage
Quick Start Laravel 5.5x and greater
SUPER_ADMIN_EMAIL=my_super_admin_here@mysite.me
- Add the SUPER_ADMIN_EMAIL to your .env file with the email of the registered user that will act as your super-admin.
php artisan vendor:publish --tag=dashauth-config
- From the console use the
--tagoption to publishconfig file
'roles' => [ 'superadmin' => "Super Admin", 'admin' => "Admin", 'staff' => "Staff", 'editor' => "Editor", 'member' => "Member", ], 'abilities' => [ 'assign_roles' => 'Assign Roles', 'manage_users' => 'Manage Users', 'manage_posts' => 'Manage Posts', 'manage_admin' => 'Manage Site', 'manage_systems' => 'Manage Systems', ],
- Edit the config settings (optional), go to
config/dashauth.php
Dashauth::routes();
- Add the default dash routes, open
routes\web.phpfile and add the above
Setup SuperAdmin Role
- Set the superadmin email in you
.envfileSUPERADMIN_EMAIL=youremail@you.com - Next go to
yoursite.com/dashauthand create a super admin - Manage \ View privileges
yoursite.com/dashauth/privileges
Manage Roles Component
Add the manage roles component to application passing the user info $user = User::find(1)
<p class="subtitle is-3">Manage Roles</p> @component("dashauth::forms.privileges", [ "user" => $user ) ]) @slot('btn_class') button is-link is-large is-uppercase @endslot @endcomponent
- Dash auth comes with a simple component to manage roles you can add the component
forms.rolescomponent to you user record.
Manage Abilities (privileges)
@component('dashauth::components.privileges')
- Assign and remove abilities to/from using the
dashauth::components.privilegescomponent.
Larvel 5.4x
Add the service provider to the config/app.php file
"providers" => [ ShawnSandy\DashAuth\DashAuthServicesProvider::class, ]
Add the facade to config/app.php file
aliases => [ "Dashauth" => ShawnSandy\DashAuth\DashAuthFacade::class, ]
Change log
Please see CHANGELOG for more information on what has changed recently.
Testing
$ composer test
Contributing
Please see CONTRIBUTING and CONDUCT for details.
Security
If you discover any security related issues, please email shawnsandy04@gmail.com instead of using the issue tracker.
Credits
- [Shawn Sandy][link-author]
- [All Contributors][link-contributors]
License
The MIT License (MIT). Please see License File for more information.
统计信息
- 总下载量: 14
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2018-01-24

