Register

You have the option to register an user using the email and password. To access this page, just click add /register in the URL.

The App\Http\Controllers\ProfileController handles the update of the user information and password.


                    /**
                    * Create a new user instance after a valid registration.
                    *
                    * @param  array  $data
                    * @return \App\User
                    */
                    protected function create(array $data)
                    {
                        return User::create([
                            'name' => $data['name'],
                            'email' => $data['email'],
                            'role_id' => $data['user_type'],
                            'password' => Hash::make($data['password']),
                        ]);
                    }
            

Validation is taken care of in .app/Http/Controllers/Auth/RegisterController.php.


                    protected function validator(array $data)
                    {
                        return Validator::make($data, [
                            'name' => ['required', 'string', 'max:255'],
                            'email' => ['required', 'string', 'email', 'max:255', 'unique:users'],
                            'user_type' => ['required'],
                            'password' => ['required', 'string', 'min:6', 'confirmed'],
                        ]);
                    }