oliuz/teamroles
Composer 安装命令:
composer require oliuz/teamroles
包简介
Team Roles expansion on oliuz/teamwork
关键字:
README 文档
README
Installation
This package is very easy to setup and install.
Composer
Pull this package in through Composer (file composer.json).
{ "require": { "oliuz/teamroles": "^3.0.0" } }
The run composer install or composer update.
Alternatively you can run composer require oliuz/teamroles to install this package.
Service Provider
Add the package to your application service providers in config/app.php file.
'providers' => [ /* * Laravel Framework Service Providers... */ Illuminate\Foundation\Providers\ArtisanServiceProvider::class, Illuminate\Auth\AuthServiceProvider::class, ... /** * Third Party Service Providers... */ Tehcodedninja\Teamroles\TeamRoleProvider::class, ],
Config File And Migrations
Publish the package config file and migrations to your application. Run these commands inside your terminal.
php artisan vendor:publish --provider="Tehcodedninja\Teamroles\TeamRoleProvider" --tag=config
php artisan vendor:publish --provider="Tehcodedninja\Teamroles\TeamRoleProvider" --tag=migrations
And also run migrations.
php artisan migrate
Models
User
Add the UsedByUsers trait to your existing User model:
<?php namespace App; use Mpociot\Teamwork\Traits\UserHasTeams; use Tehcodedninja\Teamroles\Traits\UsedByUsers; class User extends Model { use UserHasTeams; use UsedByUsers { // Add these lines starting here UsedByUsers::isOwnerOfTeam insteadof UserHasTeams; // } // Till here }
This will enable the relation with TeamRoles and add the following methods teamRoles(), teamRoleFor($team) isOwnerOfTeam($team), CurrentTeamRole(), isTeamRole($team_role), updateTeamRole($team_role, $team) within your User model.
Don't forget to dump composer autoload
composer dump-autoload
Scaffolding
The easiest way to give your new Laravel project Team Role abilities is by adding the demo application service provider in config/app.php file.
'providers' => [ /* * Laravel Framework Service Providers... */ Illuminate\Foundation\Providers\ArtisanServiceProvider::class, Illuminate\Auth\AuthServiceProvider::class, ... /** * Third Party Service Providers... */ Tehcodedninja\Teamroles\TeamRoleDemoProvider::class, ],
Adding this service provider links all the Models/Views/Controllers to you application without moving anything.
The demo provides you everything like TeamWork does but with the ability to assign roles to people for each team:
- Team listing
- Team creation / editing / deletion
- Invite new members to teams
- Team Role creation / editing / deletion
- Change members' role
To get started, take a look at the new installed /teamroles and /admin/teamroles in your project.
oliuz/teamroles 适用场景与选型建议
oliuz/teamroles 是一款 基于 HTML 开发的 Composer 扩展包,目前已累计 40 次下载、GitHub Stars 达 1, 最近一次更新时间为 2019 年 05 月 20 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「roles」 「teamwork」 「teamroles」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 oliuz/teamroles 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 oliuz/teamroles 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 oliuz/teamroles 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Laravel Multiauth package
This package provides a flexible way to add Role-based Permissions to Laravel 6.x
This package provides a flexible way to add Role-based Permissions to Laravel
PHP wrapper for the Teamwork project management API
PHP wrapper for the Teamwork project management API
Helpdesk support integrations for Craft CMS
统计信息
- 总下载量: 40
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 2
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2019-05-20