F
Filament11mo ago
Anish

Registration Event

When a registration happens in a particular panel, is an event triggered? If so, what is the event and what data is passed to the event? If not, I will suggest that an event, say Registered, with the following data
[
'panel' => $panel,
'user' => $user,
'data' => ...
]
[
'panel' => $panel,
'user' => $user,
'data' => ...
]
may be triggered. In the data array, other custom fields (not required for the user model) may be included. This will be very useful in customizing any post registration actions that need to be carried out. A listener may take suitable action for customisation. Let me know what any of you think.
5 Replies
alxndre
alxndre10mo ago
Hi! Did you figure out how to do this? I'm trying to perform some post-registration actions as well and can't make it work.
Tim van Heugten
Tim van Heugten10mo ago
Why not use the User created model event? Or am I misunderstanding the question?
Anish
AnishOP10mo ago
The user created event will have the data of the user. But I want to pass extra data which may not be part of the user. Let me give context in my case: I am working on the application portal for students. There are 3 groups of students and the application forms are very different for different groups. So I am planning to put an extra field in the registration form which will identify the group. After registration, depending on the group, I want to create the model in the corresponding student in that group. But the user will not have information about the group. So if there is an event triggered with this data, a listener can act on it
Tim van Heugten
Tim van Heugten10mo ago
And why not store a group_id or registration_group_id (in case they can change it later) on the user?
Anish
AnishOP10mo ago
Not sure I follow. Where should I keep this group_id, and how do I even get the group id? Please note that once the student is in this group, they can't change it and only given forms which are applicable to the group.
Want results from more Discord servers?
Add your server