承接 gammamatrix/playground-auth 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

gammamatrix/playground-auth

Composer 安装命令:

composer require gammamatrix/playground-auth

包简介

The Playground authentication and authorization package for Laravel applications.

README 文档

README

Playground CI Workflow Test Coverage PHPStan Level 10 src and tests

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.

screenshot of artisan about command with Playground Auth.

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:

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',
// ...

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.

统计信息

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

GitHub 信息

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

其他信息

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