alextigaer/team-auth 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

alextigaer/team-auth

Composer 安装命令:

composer require alextigaer/team-auth

包简介

A simple multi-auth package for laravel 5.*

README 文档

README

A simple multi-auth package for Laravel 5.5/6

Table of Contents

Installation

composer require alextigaer/team-auth

Basic usage

To create a new role, just run the command:

php artisan team-auth:create RoleName

This command will:

  • Create 5 controllers inside the App\Http\Controllers\RoleName directory:
    • ForgotPasswordController
    • LoginController
    • RegisterController
    • ResetPasswordController
    • RoleNameController
  • Create 5 (+ 1 if the layouts\app.blade.php file is missing) views inside the resources\views\role_name directory:
    • passwords\email.blade.php
    • passwords\reset.blade.php
    • dashboard.blade.php
    • login.blade.php
    • register.blade.php
  • Create RoleName's model inside models' directory
  • Edit config\auth.php file to add the guard, the provider and the password resets for the role
  • Create 2 migrations:
    • create_role_names_table
    • create_role_names_password_resets_table
  • Create RoleNameSeeder and update DatabaseSeeder to call the generated seeder
  • Edit routes\web.php file to add the routes for the role

Options

If you want, you can use these options to customize the creation:

--r (default=y)

This option allows to choose if the users will be able to register to this role. Choosing the 'n' value, the RegisterController file and the register blade file won't be created and the register routes won't be added to the routes\web file.

Possible values: y (default), n

Description:

{--r=y : Choose if users can register to this role, or not [y/n]}

Usage:

// Create the role excluding the possibility to register
php artisan team-auth:create RoleName --r=n

--controllers (default=y)

This option allows to choose if the controllers should be created.

Possible values: y (default), n

Description:

{--controllers=y : Choose whether to create controllers, or not [y/n]}

Usage:

// Create the role without creating the controllers
php artisan team-auth:create RoleName --controllers=n

--views (default=y)

This option allows to choose if the views should be created.

Possible values: y (default), n

Description:

{--views=y : Choose whether to create views, or not [y/n]}

Usage:

// Create the role without creating the views
php artisan team-auth:create RoleName --views=n

--model (default=y)

This option allows to choose if the model should be created.

Possible values: y (default), n

Description:

{--model=y : Choose whether to create model, or not [y/n]}

Usage:

// Create the role without creating the model
php artisan team-auth:create RoleName --model=n

--config-auth (default=y)

This option allows to choose if the config\auth file should be edited.

Possible values: y (default), n

Description:

{--config-auth=y : Choose whether to edit config\auth file, or not [y/n]}

Usage:

// Create the role without editing the config\auth file
php artisan team-auth:create RoleName --config-auth=n

--migrations (default=y)

This option allows to choose if the migrations should be created.

Possible values: y (default), n

Description:

{--migrations=y : Choose whether to create migrations, or not [y/n]}

Usage:

// Create the role without creating the migrations
php artisan team-auth:create RoleName --migrations=n

--m (default=n)

This option allows to choose if the migrate should be run.

Possible values: y, n (default)

Description:

{--m=y : Choose whether to run the command migrate, or not [y/n]}

Usage:

// Create the role running the migrate command
php artisan team-auth:create RoleName --m=y

--seeder (default=y)

This option allows to choose if the seeder should be created.

Possible values: y (default), n

Description:

{--seeder=y : Choose whether to create seeder, or not [y/n]}

Usage:

// Create the role without creating the seeder
php artisan team-auth:create RoleName --seeder=n

--s (default=n)

This option allows to choose if the db:seed should be run.

Possible values: y, n (default)

Description:

{--s=y : Choose whether to run the command db:seed, or not [y/n]}

Usage:

// Create the role running the db:seed command
php artisan team-auth:create RoleName --s=y

--routes-web (default=y)

This option allows to choose if the routes\web file should be edited.

Possible values: y (default), n

Description:

{--routes-web=y : Choose whether to edit routes\web file, or not [y/n]}

Usage:

// Create the role without editing the routes\web file
php artisan team-auth:create RoleName --routes-web=n

Config

This package has its own configuration file. Inside that file, you'll find:

  • An entry to specify where your models are
  • The default values for the options. These values will be overwritten if you use the options by command line

Usage examples

  1. Create a role called 'Admin' without creating the seeder, but running the migrations:
php artisan team-auth:create Admin --m=y --seeder=n
  1. Create a role called 'Mod' preventing the users to register to this role:
php artisan team-auth:create Mod --r=n
  1. Create a role called 'SuperUser' creating only the model:
php artisan team-auth:create SuperUser --controllers=n --views=n --config-auth=n --migrations=n --seeder=n --routes-web=n

Contributing

Feel free to suggest anything! Use pulls or contact me :)

License

TeamAuth is licensed under the MIT license. Made with love, let's share it! :)

alextigaer/team-auth 适用场景与选型建议

alextigaer/team-auth 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 16 次下载、GitHub Stars 达 0, 最近一次更新时间为 2018 年 06 月 10 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「laravel」 「multiauth」 「multi-auth」 「team-auth」 「teamauth」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 alextigaer/team-auth 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 alextigaer/team-auth 我们能提供哪些服务?
定制开发 / 二次开发

基于 alextigaer/team-auth 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 16
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 13
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-06-10