ryangjchandler/filament-user-resource
最新稳定版本:v0.3.0
Composer 安装命令:
composer require ryangjchandler/filament-user-resource
包简介
A simple resource for managing users in Filament.
README 文档
README
This package provides a UserResource class that lets you create and update User models from Filament. This is designed to work with Laravel's default User model.
Installation
You can install the package via Composer:
composer require ryangjchandler/filament-user-resource
You can publish the config file with:
php artisan vendor:publish --tag="filament-user-resource-config"
Usage
The UserResource class is automatically registered with Filament so there's very little setup.
Enabling password changes
By default, the password for a User can't be updated from Filament. This is a personal preference, but can be enabled by calling UserResource::enablePasswordUpdates() inside of a service provider.
use RyanChandler\FilamentUserResources\Resources\UserResource; public function boot() { UserResource::enablePasswordUpdates(); }
You can also provide a callback function to this method to conditionally enable password updates, e.g. allowing administrators to update passwords but not other users.
use RyanChandler\FilamentUserResources\Resources\UserResource; public function boot() { UserResource::enablePasswordUpdates(function (): bool { return auth()->user()->role === Role::Admin; }); }
Testing
composer test
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
License
The MIT License (MIT). Please see License File for more information.
统计信息
- 总下载量: 701
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 14
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2022-05-01