web-id/ail 问题修复 & 功能扩展

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

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

web-id/ail

最新稳定版本:1.0.2

Composer 安装命令:

composer require web-id/ail

包简介

Authentication page to change user easily in debug mode

README 文档

README

Latest Version on Packagist Total Downloads

Authentication page to change user easily

Ail homepage

Installation

1/ Composer

You can install the package via composer:

composer require web-id/ail

2/ Package installation

Install the package (config file and views) with this command :

php artisan ail:install

3/ Configuration

Update the config, especially guard and allowedEnv.

This is the content of the published config files:

return [
    /*
    |--------------------------------------------------------------------------
    | Route configuration
    |--------------------------------------------------------------------------
    |
    | These values will change the route configuration for the application routes.
    | You can define the prefix, the name and set your own middleware on it.
    | Web middleware is required for authentication and CanImpersonate for security.
    |
    */

    'routes' => [
        'prefix' => 'ail',
        'name' => 'ail',
        'middlewares' => [
            'web',
            CanImpersonate::class,
        ],
    ],

    /*
    |--------------------------------------------------------------------------
    | Guards to display
    |--------------------------------------------------------------------------
    |
    | This value is a list of guards that you want to display and impersonate. You
    | need to set the name on key and the service builder on value. The service
    | builder is required for search bar on view. By default, you can use
    | SearchUser::class that search on `name` attribute. You are free and encouraged
    | to create your own service.
    |
    */

    'guards' => [
        'web' => SearchUser::class,
    ],

    /*
    |--------------------------------------------------------------------------
    | Allowed environment security
    |--------------------------------------------------------------------------
    |
    | This value is a list of environments authorized for this package. It will
    | use APP_ENV. WARNING : This package is not recommended on risky environments
    | like production or preprod with sensitive data.
    */

    'allowedEnv' => [
        'local',
        'preproduction',
    ],

    /*
    |--------------------------------------------------------------------------
    | Pagination
    |--------------------------------------------------------------------------
    |
    | This value is the pagination number for view.
    |
    */

    'perPage' => 15,
];

4/ Update Models

Add Impersonate Trait on Authenticatable Models you want to impersonate.

class User extends Authenticatable
{
    use Impersonate;
}

5/ Update Views

You can add your own logic on resources/views/vendors/ail.

By default, it will display the name attribute.

6/ More options

See : https://github.com/404labfr/laravel-impersonate

WARNING : Don't forget to set authorization for who can impersonate : https://github.com/404labfr/laravel-impersonate#defining-impersonation-authorization

By default all users can be impersonated.

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.

统计信息

  • 总下载量: 1.3k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 2
  • 点击次数: 3
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-11-23

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固