gammamatrix/playground-auth
Composer 安装命令:
composer require gammamatrix/playground-auth
包简介
The Playground authentication and authorization package for Laravel applications.
关键字:
README 文档
README
The Playground authentication and authorization package for Laravel applications.
Read more on using Playground Auth at the Read the Docs for Playground.
Installation
You can install the package via composer:
composer require gammamatrix/playground-auth
NOTE: This package is required by Playground: Login Blade
artisan about
Playground Auth provides information in the artisan about command.
Configuration
You can publish the config file with:
php artisan vendor:publish --provider="Playground\Auth\ServiceProvider" --tag="playground-config"
See the contents of the published config file: config/playground-auth.php
The default configuration utitlizes:
- Sanctum
- Users may have additional abilities in the
Playground\Models\User:users.abilities - The Playground user model uses a UUID primary key along with additional fields. See the migration for
Playground\Models\User
Abilities, Privileges, Roles and Sanctum
Depending on your needs, there are multiple middleware, authentication and authorization options available.
Abilities may be used with wildcards at multiple levels. Optionally, these abilities may be used with Sanctum for API Tokens.
Here is an example of the configurable abilities:
'abilities' => [ 'root' => [ '*', ], 'admin' => [ 'app:*', 'playground:*', 'playground-auth:*', 'playground-cms:*', 'playground-cms-resource:*', 'playground-matrix:*', 'playground-matrix-resource:*', ], 'manager' => [ 'app:view', 'playground:view', 'playground-auth:logout', 'playground-auth:reset-password', // ... 'user' => [ 'app:view', // ... ], // No abilities for guests: 'guest' => [ 'none', ], // Allow abilities for guests: 'guest' => [ 'app:view', 'playground:view', 'playground-auth:logout', 'playground-auth:reset-password', // ...
- Packages may also be enabled to load privileges with the PLAYGROUND_AUTH_PACKAGES environment variable.
Environment Variables
Read more about environment variables in the config/playground-auth.php on Read the Docs: Playground.
User model types
Playground tests many different User model types to support any ecosystem.
Make sure your app is configured for the proper user model in the Laravel configuration:
'providers' => [ 'users' => [ 'driver' => 'eloquent', 'model' => env('AUTH__MODEL', App\Models\User::class), ],
During testing, Playground tests user various models.
config(['auth.providers.users.model' => 'Playground\\Models\\User'])
Commands
This package adds a command to hash a password from the command line:
artisan auth:hash-password 'some password'
artisan auth:hash-password 'some password' --json --pretty
{
"hashed": "$2y$10$langzXKRw1GgO6VgF0IrSecqxi3gAsU5NgmmERT\/2pQXg06mSbEjS"
}
Cloc
composer cloc
PHPStan
Tests at level 9 on:
config/database/lang/resources/views/src/tests/Feature/tests/Unit/
composer analyse
Coding Standards
composer format
Testing
composer test
Changelog
Please see CHANGELOG for more information on what has changed recently.
Credits
License
The MIT License (MIT). Please see License File for more information.
gammamatrix/playground-auth 适用场景与选型建议
gammamatrix/playground-auth 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 589 次下载、GitHub Stars 达 0, 最近一次更新时间为 2024 年 02 月 10 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「authorization」 「Authentication」 「auth」 「laravel」 「playground」 「sanctum」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 gammamatrix/playground-auth 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 gammamatrix/playground-auth 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 gammamatrix/playground-auth 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Laravel Multiauth package
Automatically logs-in users if they are already authenticated by a remote source. (e.g. environment variable REMOTE_USER)
GraphQL authentication for your headless Craft CMS applications.
Ory-Hydra OAuth 2.0 Client Provider for The PHP League OAuth2-Client
A lightweight and powerful OAuth 2.0 authorization and resource server library with support for all the core specification grants. This library will allow you to secure your API with OAuth and allow your applications users to approve apps that want to access their data from your API.
Laravel middleware to restrict a site or specific routes using HTTP basic authentication
统计信息
- 总下载量: 589
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 24
- 依赖项目数: 14
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-02-10
