Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Michael Fayez's avatar

need to attach role in registration

Dear best Team :) kindly help me how to attach role throw registration as Teacher or Student, here are my code :-

                        <label for="role_id" value="{{ __('Register as:') }}" />
                        <select name="role_id"  class="form-control">
                           
                            <option value="2">Student</option>
                             role_id = 2
                        
                            <option value="3">Teacher</option> 
                            role->id= 3
                            
                           
                        </select>
                    </div>```
Thanks in advance
0 likes
3 replies
jlrdw's avatar

Don't, have the system assign the role. Should have separate sign ups (portals) for the various roles.

jlrdw's avatar

@Michael Fayez an example is a health portal, you need separate "pages" for doctor verses patient. Same with student and teacher. Don't let a user assign their role. Send a code to them with a link whereby they are only allowed to signup as whatever the role is allowed. Just my suggestion.

Please or to participate in this conversation.