momenoor/backpackusermanager
Composer 安装命令:
composer require momenoor/backpackusermanager
包简介
Users management interface for Laravel using Backpack CRUD.
关键字:
README 文档
README
An admin interface to easily add/edit/remove users, using Backpack for Laravel
Backpack 4
Backpack 3
Security updates and breaking changes
Please subscribe to the Backpack Newsletter so you can find out about any security updates, breaking changes or major features. We send an email every 1-2 months.
Install on Backpack v4.1 (Laravel 6 or Laravel 7)
- In your terminal:
composer require momenoor/backpackusermanager
- Add Backpack's CrudTrait on your User model:
By default: app/User.php
namespace App; class BackpackUser extends User { use \Backpack\CRUD\app\Models\Traits\CrudTrait; // <--- Add this line // ...
- [Optional] If your User model is NOT
App\User::classor your users table is notusers, you should publish this package's config file and correct those assumptions in theconfig/momenoor/usermanager.phpfile. To publish file, run:
php artisan vendor:publish --provider="Momenoor\UserManager\UserManagerServiceProvider" --tag='config'
- [Optional] Add a sidebar link
php artisan backpack:add-sidebar-content "<li class='nav-item'><a class='nav-link' href='{{ backpack_url('user') }}'><i class='nav-icon la la-user'></i> <span>Users</span></a></li>"
(alternatively, manually add an item in resources/views/vendor/backpack/base/inc/sidebar_content.blade.php or menu.blade.php)
Install on Backpack v4.0 (Laravel 6 or Laravel 7)
- In your terminal:
composer require momenoor/backpackusermanager
- Add Backpack's CrudTrait on your User model:
By default: app/Models/BackpackUser.php
namespace App\Models; use App\User; use Backpack\CRUD\app\Models\Traits\InheritsRelationsFromParentModel; use Backpack\CRUD\app\Notifications\ResetPasswordNotification as ResetPasswordNotification; use Illuminate\Notifications\Notifiable; use Backpack\CRUD\app\Models\Traits\CrudTrait; <--- Add this line class BackpackUser extends User { use InheritsRelationsFromParentModel; use Notifiable; use CrudTrait; <--- Add this line ...
- [Optional] Add a sidebar link
php artisan backpack:add-sidebar-content "<li class='nav-item'><a class='nav-link' href='{{ backpack_url('user') }}'><i class='nav-icon fa fa-user'></i> <span>Users</span></a></li>"
(alternatively, manually add an item in resources/views/vendor/backpack/base/inc/sidebar_content.blade.php or menu.blade.php)
Install on Backpack v3 (Laravel 5)
- In your terminal:
composer require momenoor/backpackusermanager
- For Laravel <5.5, add the service provider to your config/app.php file:
Momenoor\UserManager\UserManagerServiceProvider::class,
- Use the following traits on your User model:
<?php namespace App; use Backpack\CRUD\CrudTrait; // <------------------------------- this one use Illuminate\Foundation\Auth\User as Authenticatable; class User extends Authenticatable { use CrudTrait; // <----- this /** * Your User Model content */
- [Optional] Add a menu item for it:
php artisan backpack:base:add-sidebar-content "<li><a href='{{ backpack_url('user') }}'><i class='fa fa-user'></i> <span>Users</span></a></li>"
(alternatively, manually add an item in resources/views/vendor/backpack/base/inc/sidebar_content.blade.php or menu.blade.php)
How to extend this package
When you need more control on your user model, the best way is copying the code.
You can even make your own CRUD controller with php artisan backpack:crud user and simply add handlePasswordInput addFields methods in src/app/Http/Controllers/UserCrudController. See code
To copy source code into your project
Go to vendor/momenoor/usermanager/src and copy:
-
Route:
routes/momenoor/usermanager.phpin yourroutes/web.phpfile -
Controller
app/Http/Controllers/UserCrudController.phpinside yourapp/Http/Controllersfolder -
Requests
app/Http/Requests/*inside yourapp/Http/Controllersfolder -
In UserCrudController set the model, example:
$this->crud->setModel('App\User'));
-
In every file, replace my namespace
Momenoor\UserManager\app\Http\RequestsforApp\Http\Requests
Now you can remove the package with composer:
composer remove eduardoarandah/usermanager
Documentation for fields (updating/creating)
https://laravel-backpack.readme.io/docs/crud-fields
Documentation for columns (list view)
https://laravel-backpack.readme.io/docs/crud-columns-types
Upgrade from Backpack 4.0 to 4.1
To successfully use this package after you upgrade your project from Backpack 4.0 to Backpack 4.1, you need to:
- require version
^3.0of this package by changing yourcomposer.jsonfile or runningcomposer require momenoor/usermanager:"^3.0"; - (most likely) change the user model in the usermanager config file from
App\Models\BackpackUser::classtoApp\User::class; - (less likely) if you've extended the UserCrudController in this package and you've modified the
handlePasswordInput()function, you also need to take account that the crud request in now fetched using setters and getters instead of directly as a property; take a closer look at Step 11 in the Backpack 4.1 upgrade guide, or look at the new code in this package for inspiration;
momenoor/backpackusermanager 适用场景与选型建议
momenoor/backpackusermanager 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 11 次下载、GitHub Stars 达 0, 最近一次更新时间为 2023 年 04 月 12 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「User management」 「manage users」 「backpack」 「laravel backpack」 「backpack user management」 「users admin」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 momenoor/backpackusermanager 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 momenoor/backpackusermanager 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 momenoor/backpackusermanager 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Forked from https://github.com/deltaaskii/lara-pdf-merger. Add condition if(!class_exists('TCPDF')) (depreciated in php 7.2) to foreach.
The library provides a flexible way to add role-based access control management to CakePHP 3.x
A Silverstripe module to allow you to log into any of your Silverstripe sites from one place.
Task system for APPUI
Standalone replacement for php's native get_browser() function
统计信息
- 总下载量: 11
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 25
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-04-12

