gammamatrix/playground-login-blade
Composer 安装命令:
composer require gammamatrix/playground-login-blade
包简介
Playground: Provides an API and a Laravel Blade UI for authentication, authorization, credential updates and user verification.
README 文档
README
The Playground Login Blade package for Laravel applications.
This package provides Authentication Controllers and Blade UI handling:
- Email Address Verification
- Password Management
- Authentication Supporting Roles, Privileges or Sanctum
- User Registration
- Supports logging out all devices with Sanctum.
- Provides API Tokens via Sanctum.
Read more on using Playground Login Blade at Read the Docs: Playground Documentation.
Installation
You can install the package via composer:
composer require gammamatrix/playground-login-blade
artisan about
Playground Login Blade provides configuration information in the artisan about command.
Configuration
If you need to customize the configuration, you can publish the config file with:
php artisan vendor:publish --provider="Playground\Login\Blade\ServiceProvider" --tag="playground-config"
See the contents of the published config file: config/playground-login-blade.php
You can publish the views file with:
php artisan vendor:publish --provider="Playground\Login\Blade\ServiceProvider" --tag="playground-view"
User Model
Playground tries to support as many auth handling methods as possible.
Currently, the following contracts are used for various package features.
Illuminate\Contracts\Auth\MustVerifyEmail
See the Email Verification Controller
- routes for email verification
- Middleware configuration:
config('playground-login-blade.middleware.auth')
Illuminate\Contracts\Auth\Authenticatable
Laravel\Sanctum\Contracts\HasApiTokens
Playground\Models\Contracts\Abilities
public function addAbility(mixed $ability): void; public function hasAbility(mixed $ability): bool; public function removeAbility(mixed $ability): void;
Abilities may be used with Sanctum. Abilities are included in Playground\Models\User with the trait:
Playground\Models\Contracts\Admin
public function isAdmin(): bool;
Playground\Models\Contracts\Privileges
public function addPrivilege(mixed $privilege): void; public function hasPrivilege(mixed $privilege): bool; public function removePrivilege(mixed $privilege): void;
Playground\Models\Contracts\Role
public function addRole(mixed $role): void; public function hasRole(mixed $role): bool; public function removeRole(mixed $role): void;
- TODO Move this info to the wikis.
Environment Variables
Loading
| env() | config() |
|---|---|
PLAYGROUND_LOGIN_BLADE_LOAD_VIEWS |
playground-login-blade.load.views |
PLAYGROUND_LOGIN_BLADE_LOAD_ROUTES |
playground-login-blade.load.routes |
PLAYGROUND_LOGIN_BLADE_LOAD_ROUTESmust be enabled to load the routes in the application (unless published to your app - the control for this is in the ServiceProvider.php)
Routes
All routes are disabled by default in the base Playground package.
| env() | config() |
|---|---|
PLAYGROUND_LOGIN_BLADE_ROUTES_CONFIRM |
playground-login-blade.routes.confirm |
PLAYGROUND_LOGIN_BLADE_ROUTES_FORGOT |
playground-login-blade.routes.forgot |
PLAYGROUND_LOGIN_BLADE_ROUTES_LOGIN |
playground-login-blade.routes.login |
PLAYGROUND_LOGIN_BLADE_ROUTES_LOGOUT |
playground-login-blade.routes.logout |
PLAYGROUND_LOGIN_BLADE_ROUTES_REGISTER |
playground-login-blade.routes.register |
PLAYGROUND_LOGIN_BLADE_ROUTES_RESET |
playground-login-blade.routes.reset |
PLAYGROUND_LOGIN_BLADE_ROUTES_TOKEN |
playground-login-blade.routes.token |
PLAYGROUND_LOGIN_BLADE_ROUTES_VERIFY |
playground-login-blade.routes.verify |
Middleware
The middleware values can be customized. See the default values on the command line with: artisan about
| env() | config() |
|---|---|
PLAYGROUND_LOGIN_BLADE_MIDDLEWARE_AUTH |
playground-login-blade.routes.auth |
PLAYGROUND_LOGIN_BLADE_MIDDLEWARE_DEFAULT |
playground-login-blade.routes.default |
PLAYGROUND_LOGIN_BLADE_MIDDLEWARE_GUEST |
playground-login-blade.routes.guest |
Sessions
By default, authentication tokens will be saved in the session. Sessions use the Laravel web middleware.
| env() | config() |
|---|---|
PLAYGROUND_LOGIN_BLADE_SESSION |
playground-login-blade.routes.session |
Sitemap
This package provides support for displaying a website map with the Playground Site Blade package.
| env() | config() |
|---|---|
PLAYGROUND_LOGIN_BLADE_SITEMAP_ENABLE |
playground-login-blade.sitemap.enable |
PLAYGROUND_LOGIN_BLADE_SITEMAP_GUEST |
playground-login-blade.sitemap.guest |
PLAYGROUND_LOGIN_BLADE_SITEMAP_USER |
playground-login-blade.sitemap.user |
PLAYGROUND_LOGIN_BLADE_SITEMAP_VIEW |
playground-login-blade.sitemap.view |
UI
If PLAYGROUND_LOGIN_BLADE_LAYOUT is not set, it defaults to PLAYGROUND_BLADE_LAYOUT from the base Playground Blade package.
| env() | config() |
|---|---|
PLAYGROUND_LOGIN_BLADE_LAYOUT |
playground-login-blade.layout |
PLAYGROUND_LOGIN_BLADE_VIEW |
playground-login-blade.view |
Cloc
composer cloc
➜ playground-login-blade git:(develop) ✗ composer cloc
> cloc --exclude-dir=output,vendor .
76 text files.
53 unique files.
25 files ignored.
github.com/AlDanial/cloc v 1.98 T=0.08 s (698.4 files/s, 61178.1 lines/s)
-------------------------------------------------------------------------------
Language files blank comment code
-------------------------------------------------------------------------------
PHP 38 559 749 2005
Blade 7 66 0 544
YAML 1 5 0 275
XML 2 0 2 144
Markdown 3 72 0 140
JSON 1 0 0 67
INI 1 3 0 12
-------------------------------------------------------------------------------
SUM: 53 705 751 3187
-------------------------------------------------------------------------------
PHPStan
Tests at level 9 on:
config/database/resources/src/tests/Feature/tests/Unit/
composer analyse
Coding Standards
composer format
Tests
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-login-blade 适用场景与选型建议
gammamatrix/playground-login-blade 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 352 次下载、GitHub Stars 达 0, 最近一次更新时间为 2024 年 02 月 08 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「login」 「auth」 「laravel」 「blade」 「sanctum」 「gammamatrix」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 gammamatrix/playground-login-blade 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 gammamatrix/playground-login-blade 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 gammamatrix/playground-login-blade 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
WeChat OAuth SDK
Laravel Multiauth package
Debugging a problem and need to login as one of your customers? This allows you to authenticate as any of your customers.
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.
This package provides a flexible way to add Role-based Permissions to Laravel 6.x
Email Toolkit Plugin for CakePHP
统计信息
- 总下载量: 352
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 14
- 依赖项目数: 9
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-02-08
