gammamatrix/playground-login-blade 问题修复 & 功能扩展

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

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

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

Playground CI Workflow Test Coverage PHPStan Level 10 src and tests

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.

screenshot of artisan about command with Playground Login Blade.

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

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_ROUTES must 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 我们能提供哪些服务?
定制开发 / 二次开发

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

BUG 修复 & 性能优化

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

项目外包 & 长期维护

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

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

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-02-08