Changing registration form
Hi,
I'd like to significantly change registration form, so in my case to remove "name" field, use email and password only, when they saved I'd like to assign them "guest" role. When user is registered and email confirmed I'd like to open a wizard where then can provide first and last name, phone number and adres. They can do it or skip it, but if they decide to skip it they can only view the service and any action other than view would open "fill details" view which when saved would change the role to "member".
Can I achieve these somehow easily by some triggers/events/actions; or it would required to create more custom registration and copy&paste original ones and change it in multiple places?
2 Replies
For customizing registration, you would need to build your Registration class, like here: https://filamentphp.com/docs/3.x/panels/users#customizing-the-authentication-features
Our tutorial about adding extra field: https://laraveldaily.com/post/filament-registration-form-extra-fields-choose-user-role
But you can add more fields, and/or you can build a Wizard inside that class, too, with your second step.
For checking the fields on every action, you would need to build a Laravel Middleware, and then apply it on the panel here: https://filamentphp.com/docs/3.x/panels/configuration#applying-middleware-to-authenticated-routes
Thank you 🙂 I'll follow that