# Sign Up

You can register as a user by filling in the name, email and password for your account.

You can do this by accessing the sign up page from the Sign Up button in the top navbar or by clicking the Sign Up button from the bottom of the log in form or if you are logged in from the Sign Up button from the sidebar. Another simple way is adding `/sign-up` in the url.

The `App\Http\Livewire\Auth\SignUp` handles the registration of a new user.

                    public function register() {
                        $this->validate();
                        $user = User::create([
                            'name' => $this->name,
                            'email' => $this->email,
                            'password' => Hash::make($this->password)
                        ]);
                        auth()->login($user);
                        return redirect('/dashboard');
                    }

The data entered by the user are checked before being added in the database and creating an account.

                protected $rules = [
                    'name' => 'required|min:3',
                    'email' => 'required|email|unique:users',
                    'password' => 'required|min:6'
                ];