hapidjus/laravel-impersonate-ui
Composer 安装命令:
composer require hapidjus/laravel-impersonate-ui
包简介
UI for 404labfr/laravel-impersonate
关键字:
README 文档
README
Laravel Impersonate UI
Laravel Impersonate UI is a Laravel Package that adds an easy to use UI for selecting users to impersonate when using https://github.com/404labfr/laravel-impersonate
Requirements
- Laravel >= 7.0
- PHP >= 7.1 (PHP >= 8.3 for Laravel 13)
Installation
- Require laravel-impersonate-ui with Composer
composer require hapidjus/laravel-impersonate-ui
- Add the Trait
Lab404\Impersonate\Models\Impersonateto your User model.
<?php namespace App; use Illuminate\Contracts\Auth\MustVerifyEmail; use Illuminate\Foundation\Auth\User as Authenticatable; use Illuminate\Notifications\Notifiable; use Lab404\Impersonate\Models\Impersonate; class User extends Authenticatable { use Notifiable, Impersonate; }
Configuration
To publish the config and blade files use:
php artisan vendor:publish --provider="Hapidjus\ImpersonateUI\ImpersonateUiServiceProvider"
Append --tag=config or --tag=view to only publish config or blade files.
This is the contents of the config file:
return [ /** * Enable Laravel Impersonate UI * * Laravel Impersonate UI is enabled by default when in debug * */ 'enabled' => env('APP_DEBUG',false), /** * Users allowed to impersonate * * Array of user emails, i.e ['admin@example.com'] or null for all * */ 'users_allowed_to_impersonate' => ['admin@example.com'], /** * Position of icon. * * Supported: "bottom-right", "bottom-left", "top-left", "top-right" * */ 'icon_position' => 'bottom-right', /** * Show Impersonate button. * * Trying to save some clicks? * Then this is the option for you! Select a user and BOOM - * form submitted - user impersonated. No need to click any * pesky buttons. * */ 'show_button' => true, /** * Globally include laravel-impersonate-ui. * * Or use this view: @include('impersonate-ui::impersonate-ui') * Note: If you choose to include the partials view you need to add * a check to test if the current users is allowed * to impersonate */ 'global_include' => true, /** * The URI/Route to redirect after taking an impersonation. * * Use 'back' to redirect to the previous page * */ 'take_redirect_to' => 'back', /** * The URI/Route to redirect after leaving an impersonation. * * Use 'back' to redirect to the previous page * */ 'leave_redirect_to' => 'back', /** * Only allow these users to be impersonated * * Array of user IDs or null for all * */ 'users_only' => null, /** * Exlude these users from beeing impersonated * * Array of user IDs or null for none * */ 'users_exclude' => null, ];
Partials view:
You can use the partials view to include the Impersonate UI on any pages you want. Note: If you choose to include the partials view you need to add a check to test if the current users is allowed to impersonate
@include('impersonate-ui::impersonate-ui')
Have fun impersonating.
Do not use in production!
hapidjus/laravel-impersonate-ui 适用场景与选型建议
hapidjus/laravel-impersonate-ui 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 1.57k 次下载、GitHub Stars 达 37, 最近一次更新时间为 2019 年 10 月 14 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「package」 「plugin」 「user」 「auth」 「laravel」 「impersonation」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 hapidjus/laravel-impersonate-ui 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 hapidjus/laravel-impersonate-ui 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 hapidjus/laravel-impersonate-ui 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
CakePHP 4.x AdminLTE Theme.
Simple ASCII output of array data
Standalone replacement for php's native get_browser() function
User component for Yii2
Plugin for YOURLS. Default tools to use in some laemmi plugins
统计信息
- 总下载量: 1.57k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 37
- 点击次数: 24
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2019-10-14
