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.
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"
The UserResource
class is automatically registered with Filament so there's very little setup.
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;
});
}
composer test
Please see CHANGELOG for more information on what has changed recently.
Please see CONTRIBUTING for details.
Please review our security policy on how to report security vulnerabilities.
The MIT License (MIT). Please see License File for more information.