PLATFORM
  • Tails

    Create websites with TailwindCSS

  • Blocks

    Design blocks for your website

  • Wave

    Start building the next great SAAS

  • Pines

    Alpine & Tailwind UI Library

  • Auth

    Plug'n Play Authentication for Laravel

  • Designer comingsoon

    Create website designs with AI

  • DevBlog comingsoon

    Blog platform for developers

  • Static

    Build a simple static website

  • SaaS Adventure

    21-day program to build a SAAS

Question By
Solved

Possible to not require name + hide anything displaying "name"?

Solved
alexmorning

Mar 7th, 2023 01:59 AM

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

bobbyiliev

Mar 7th, 2023 02:15 AM

Best Answer

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:
            'name' => $data['name'],
    
    To:
            'name' => $username,
    
    That way the name field in database will be set to the username value. If you are using the Wave API, change the 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.

alexmorning

Mar 9th, 2023 04:22 AM

This works perfectly, that's fantastic. Thank you so much for taking the time to write so much detail.

bobbyiliev

Mar 9th, 2023 06:59 AM

Hey! No problem at all! Happy to hear that it is all working as expected!