Laravel “错误”;密码字段是必需的&引用;拉维尔

Laravel “错误”;密码字段是必需的&引用;拉维尔,laravel,passwords,registration,Laravel,Passwords,Registration,我使用Laravel的标准注册和登录。我已经根据自己的需要对其进行了调整,并扩展了几个领域。但当我创建新用户时,总是会收到错误消息“密码字段是必需的”。此错误消息来自何处 web.php // Registration Routes... Route::get('index', 'Auth\RegisterController@showRegistrationForm'); Route::post('index', 'Auth\RegisterController@register'); in

我使用Laravel的标准注册和登录。我已经根据自己的需要对其进行了调整,并扩展了几个领域。但当我创建新用户时,总是会收到错误消息“密码字段是必需的”。此错误消息来自何处

web.php

// Registration Routes...
Route::get('index', 'Auth\RegisterController@showRegistrationForm');
Route::post('index', 'Auth\RegisterController@register');
index.blade.php

<div class="col-md-6 col-md-offset-1">
                <div class="row pt-100">
        <h2>xyz</h2>
                        <form class="nomargin sky-form" method="POST" action="{{ route('register') }}">
                            {{ csrf_field() }}
                            <fieldset>

                                <div class="row">
                                    <div class="form-group {{ $errors->has('name') ? ' has-error' : '' }}">
                                        <div class="col-md-6 col-sm-6">
                                            <label class="sr-only" for="name">name</label>
                                            <label class="input margin-bottom-10">
                                                <i class="ico-append fa fa-user"></i>
                                                <input type="text" id="name" placeholder="Name" name="name" value="{{ old('name') }}" required autofocus>
                                                <b class="tooltip tooltip-bottom-right">Dein Name</b>
                                            </label>
                                        </div>
                                    </div>

                                    <div class="form-group {{ $errors->has('username') ? ' has-error' : '' }}">
                                        <div class="col-md-6 col-sm-6 mtm-15">
                                            <label class="sr-only" for="username">username</label>
                                            <label class="input margin-bottom-10">
                                                <i class="ico-append fa fa-user"></i>
                                                <input type="text" id="username" placeholder="Username" name="username" value="{{ old('username') }}" required autofocus>
                                                <b class="tooltip tooltip-bottom-right">Dein Username</b>
                                            </label>
                                        </div>
                                    </div>
                                </div>

                                <div class="row">
                                    <div class="form-group {{ $errors->has('email') ? ' has-error' : '' }}">
                                        <div class="col-md-12 col-sm-12 mtm-15">
                                            <label class="sr-only" for="email">email</label>
                                            <label class="input margin-bottom-10">
                                                <i class="ico-append fa fa-envelope"></i>
                                                <input type="email" id="email" placeholder="eMail" name="email" value="{{ old('email') }}" required autofocus>
                                                <b class="tooltip tooltip-bottom-right">Deine eMail</b>
                                            </label>
                                        </div>
                                    </div>
                                </div>

                                <div class="row">
                                    <div class="form-group {{ $errors->has('password') ? ' has-error' : '' }}">
                                        <div class="col-md-12 col-sm-12 mtm-15">
                                            <label class="sr-only" for="password">password</label>
                                            <label class="input margin-bottom-10">
                                                <i class="ico-append fa fa-lock"></i>
                                                <input type="password" id="password" minlength="6" placeholder="Passwort" requiered>
                                                <b class="tooltip tooltip-bottom-right">Min. 6 Zeichen lang</b>
                                            </label>
                                        </div>
                                    </div>
                                </div>

              <div class="row">
                                    <div class="form-group {{ $errors->has('gender') ? ' has-error' : '' }}">
                    <div class="col-md-3 pt-3">
                                            <label class="sr-only" for="male">male</label>
                                            <label class="radio">
                        <input type="radio" name="gender" value="male" id="gender" requiered autofocus>
                        <i></i> <span style="color:white">Männlich</span>
                    </label>
                  </div>
                  <div class="col-md-3 pt-3">
                                            <label class="sr-only" for="female">female</label>
                                            <label class="radio">
                        <input type="radio" name="gender" value="female" id="gender" requiered autofocus>
                    <i></i> <span style="color:white">Weiblich</span>
                    </label>
                  </div>
                                    </div>

                                <div class="form-group {{ $errors->has('birthday') ? ' has-error' : '' }}">
                <div class="col-md-6 mtm-15">
                    <label class="sr-only" for="birthday">birthday</label>
                                            <label class="input margin-bottom-10">
                                            <input type="date" id="birthday" name="birthday" value="{{ old('date') }}" placeholder="Geburtsdatum" requiered autofocus>
                                            <b class="tooltip tooltip-bottom-right">Dein Geburtsdatum</b>
                                        </label>
                </div>
                    </div>
                            </div>

                                <div class="row form-group {{ $errors->has('agb') ? ' has-error' : '' }}">
                                    <div class="col-md-12 mt-20">
                                        <label class="checkbox nomargin">
                                            <input class="checked-agree" type="checkbox" id="agb" value="agree" required>
                                            <i></i>
                                            <span style="color:white">Hiermit bestätige ich die </span>
                                            <a href="#" data-toggle="modal" data-target="#termsModal">AGB/Datenschutzerklärung</a>
                                        </label>
                                    </div>
                                </div>
                            </fieldset>

                            <div class="row">
                                <div class="form-group">
                                    <div class="col-md-12">
                                        <button type="submit" class="btn btn-primary"><i class="fa fa-check"></i> REGISTRIEREN</button>
                                    </div>
                                </div>
                            </div>
                        </form>
                    </div>
        </div>
user.php

protected $fillable = [
        'name', 'email', 'password', 'username', 'gender', 'birthday', 'agb'
    ];

    /**
     * The attributes that should be hidden for arrays.
     *
     * @var array
     */
    protected $hidden = [
        'password', 'remember_token',
    ];
}
寄存器控制器

   protected function validator(array $data)
        {
            return Validator::make($data, [
                'name' => 'required|string|max:30',
                'username' => 'required|string|max:20|unique:users',
                'email' => 'required|string|email|max:255|unique:users',
                'password' => 'required|string|min:6|confirmed',
                'gender' => 'required|string',
                'birthday' => 'required|date',
                'agb' => 'required|string',
            ]);
        }

        /**
         * 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'],
                'username' => $data['username'],
                'email' => $data['email'],
                'password' => bcrypt($data['password']),
                'gender' => $data['gender'],
                'birthday' => $data['birthday'],
                'agb' => $data['agb'],
            ]);
        }
    }

输入字段中缺少name属性

只需更改输入字段

<input type="password" id="password" minlength="6" name="password" placeholder="Password" requiered>

现在,您将收到一个确认密码无效的错误,因为您缺少密码\u确认输入字段

在注册表中包含密码确认字段

<input id="password-confirm" type="password" class="form-control" name="password_confirmation" required>


你可以走了

多谢各位。我已编辑注册表控制器并删除“已确认”。但是数据没有写入数据库。我没有收到错误消息。你知道问题出在哪里吗?很难破解我这边的错误。尝试创建具有虚拟值的用户。请尝试以下命令:
php-artisan-optimize
php-artisan-view:clear
php artisan cache:clear
php artisan config:clear
我想使用Index.blade.php中的伪值和输入字段创建一个新用户,但数据不在数据库中,并且没有收到错误消息。如何查找错误?在创建模式后是否运行了
php artisan migrate
<input id="password-confirm" type="password" class="form-control" name="password_confirmation" required>