User maintenance flow - default in Filament
Hi, couple of questions relating to user management.
1) I have a resource based on the User model and, predictably, I have the password field included - if I want to create a user I can add a record here and set my own password for that user. Anytime you want to update that user record you have to typoe in a password. Of course what I really want is a means to set a password that is independent of any update to other user fields and I wondered if this is available out of the box - or if not, some ideas as to how others have implemented this?
2) Ideally I want the process flow to be that an admin user creates another user's record (without a password) and that new user then sets their own password on first logging-in - not necessarily wedded to this flow but it seems quite straightforward (and keeps the knowledge of the password private to the new user) - but again happy to learn of examples of best practise (if there are some tutorials or links to docs on how to achieve).
I have been browsing the Filament docs and couldn't see where these fundamentals of user management were discussed. If I have to use another plugin, happy to do so.
thanks as ever,
j
7 Replies
You could use a package like this. it creates a user with a random password and sends them an invite notification with a link to reset the password
https://filamentphp.com/plugins/tapp-network-invites
You could also create this yourself quite easily without the package
Thanks, this suggestion helps with question 2 from above.
Regarding question 1, any suggestions? I am almost expecting the response to be a link to a Filament doc pages I haven't come across yet π
just remove the password field from the form
Hi, that was obviously one thought π - wondered if perhaps Filament already had the various types of user maint forms available by default (such as loggged-in user changing own password).
Just came across this - https://github.com/joaopaulolndev/filament-edit-profile - looks like it might be a nice packaging of some of what I was seeking.
GitHub
GitHub - joaopaulolndev/filament-edit-profile: Filament package to ...
Filament package to edit profile really fast. Contribute to joaopaulolndev/filament-edit-profile development by creating an account on GitHub.
@jjo63 filament ships with a user profile page
https://filamentphp.com/docs/3.x/panels/users#authentication-features
enable it with
->profile()
in the Panels Provideryou can customise the form here:
https://filamentphp.com/docs/3.x/panels/users#customizing-the-authentication-features