Sign up

You have the option to register an user using the email and password. To access this page, just click the “Page examples/ Sign up” link in the left sidebar or add /sign-up in the URL.

The app/Http/Livewire/Auth/SignUp.php handles the register process and validation.

    public function updatedEmail()
    {
        $this->validate(['email'=>'required|email|unique:users']);
    }
    
    public function register()
    {
        $this->validate([
            'email' => 'required',
            'password' => 'required|same:passwordConfirmation|min:6',
        ]);

        $user = User::create([
            'email' =>$this->email,
            'password' => Hash::make($this->password),
            'remember_token' => Str::random(10),
        ]);

        auth()->login($user);

        return redirect('/profile');
    }