0
我在我的laravel應用程序中使用Auth:命令註冊表單。我有添加新的網卡輸入框register.blade.php文件,因爲這, register.blade.php爲什麼Laravel沒有保存表單數據?
<div class="form-group{{ $errors->has('nic') ? ' has-error' : '' }}">
<label for="nic" class="col-md-4 control-label">NIC</label>
<div class="col-md-6">
<input id="nic" type="text" class="form-control" name="nic">
@if ($errors->has('nic'))
<span class="help-block">
<strong>{{ $errors->first('nic') }}</strong>
</span>
@endif
</div>
</div>
和我AuthController是這樣的,
protected function validator(array $data)
{
return Validator::make($data, [
'username' => 'required|max:255',
'email' => 'required|email|max:255|unique:users',
'password' => 'required|min:6|confirmed',
'nic' => 'required|min:10',
]);
}
protected function create(array $data)
{
return User::create([
'username' => $data['username'],
'email' => $data['email'],
'password' => bcrypt($data['password']),
'nic' => $data['nic'],
]);
}
,我有新列在用戶表中也有nic。但是當我點擊註冊按鈕時,其他數據值很好地保存在用戶表中,但是密碼欄沒有保存好的值。如何解決這個問題?
這裏沒有任何 – DNK
是sujjection'nic'在用戶級設置爲'fillable'? – aynber
是的,現在它正在工作 – DNK