Possible to not require name + hide anything displaying "name"?
Sorry for all the questions!!
I do not want to require a name at sign up...I was wondering if this was possible to accomplish without doing a lot of changing of code? I have tried but I cannot make it work.
If this is possible. I'm sure I will still need to go hide all visible inputs and data that contain anything related to "name", which is okay. I can do this manually, but I could not find the area to allow registration with no name.
Thahnk you
Hi there Alex,
I am afraid that there is no out of the box setting to change this.
You would need to manually update this directly in the code, a quick way to do this will be to only assign the username to the name column, so that you don't have to change your migration files and make the user field nullable:
- Open the
wave/src/Http/Controllers/Auth /RegisterController.php
file - Update the
validator
method and remove the two lines for the name validation:'name' => 'required|string|max:255',
that is both on line 62 and 70 - Then update the
create
method and change line 118 from:
To:'name' => $data['name'],
That way the name field in database will be set to the username value. If you are using the Wave API, change the'name' => $username,
wave/src/Http/Controllers/API/AuthController.php
as well - After that change the register blade view at
resources/views/themes/tailwind/auth/register.blade.php
and remove the name input field, starting from line 38 to 50
A different approach will be to update all of the references for the name field in the code so that it is not used anywhere, that will include changing the users migrations file as well.
Let me know if you have any questions.
This works perfectly, that's fantastic. Thank you so much for taking the time to write so much detail.
Hey! No problem at all! Happy to hear that it is all working as expected!