无法更改寄存器文件中的名称字段

时间:2017-05-08 16:07:33

标签: laravel authentication laravel-5

在普通的auth脚手架中有一个'name'字段,我将其更改为'voornaam'。但是因为我这样做了它给了我这个错误:

  

SQLSTATE [HY000]:常规错误:1364字段'voornaam'没有   默认值(SQL:插入peopleemailpassword,   updated_atcreated_at)值(**** @ hotmail.com,   $ 2Y $ 10 $ MD1lSAS1XyA3tW3MzCE68Oz9zrPDZiq0CLJRo3KEnEC / uI2K8kLui,   2017-05-08 16:03:42,2017-05-08 16:03:42))

它不会在voornaam中插入任何内容。

这是我的注册管理员:

use RegistersUsers;

/**
 * Where to redirect users after registration.
 *
 * @var string
 */
protected $redirectTo = '/home';

protected $table = 'people';

/**
 * Create a new controller instance.
 *
 * @return void
 */
public function __construct()
{
    $this->middleware('guest');
}

/**
 * Get a validator for an incoming registration request.
 *
 * @param  array  $data
 * @return \Illuminate\Contracts\Validation\Validator
 */
protected function validator(array $data)
{
    return Validator::make($data, [
        'voornaam' => 'required|max:255',
        'email' => 'required|email|max:255|unique:people',
        'password' => 'required|min:6|confirmed',
    ]);
}

/**
 * Create a new user instance after a valid registration.
 *
 * @param  array  $data
 * @return User
 */
protected function create(array $data)
{
    return User::create([
        'voornaam' => $data['voornaam'],
        'email' => $data['email'],
        'password' => bcrypt($data['password']),
    ]);
}

这是HTML部分:

<div class="col-md-6">
    <input id="voornaam" type="text" class="form-control" name="voornaam" value="{{ old('voornaam') }}" required autofocus>

    @if ($errors->has('voornaam'))
        <span class="help-block">
            <strong>{{ $errors->first('voornaam') }}</strong>
        </span>
    @endif
</div>

我做错了什么?

0 个答案:

没有答案