# 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/Controllers/RegisterController.php` handles the registration of a new user.

Copy

                    public function store()
                    {
                        $attributes = request()->validate([
                            'name' => ['required', 'max:50'],
                            'email' => ['required', 'email', 'max:50', Rule::unique('users', 'email')],
                            'password' => ['required', 'min:5', 'max:20']
                        ]);
                        $attributes['password'] = bcrypt($attributes['password'] );

                        session()->flash('success', 'Your account has been created.');
                        $user = User::create($attributes);
                        Auth::login($user);
                        return redirect('/dashboard');
                    }

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