Php 未过帐到数据库的输入数据
我有一个问题,我有三个字段,三个字段中有两个正在发布到数据库中。我会把我的代码贴在下面,看看你是否能帮我 如果您想要完整的代码预览,请访问: 我正在关注CodeCourse/PHPAcademy的社交网络教程,这只是我偶然发现的一个奇怪的错误 是的,我已经检查了数据库中的用户名字段是否拼写正确 查看Php 未过帐到数据库的输入数据,php,laravel,Php,Laravel,我有一个问题,我有三个字段,三个字段中有两个正在发布到数据库中。我会把我的代码贴在下面,看看你是否能帮我 如果您想要完整的代码预览,请访问: 我正在关注CodeCourse/PHPAcademy的社交网络教程,这只是我偶然发现的一个奇怪的错误 是的,我已经检查了数据库中的用户名字段是否拼写正确 查看 <form class="form-vertical" role="form" method="post" action="{{ route('auth.signup') }}">
<form class="form-vertical" role="form" method="post" action="{{ route('auth.signup') }}">
<div class="form-group{{ $errors->has('email') ? ' has-error' : '' }}">
<label for="email" class="control-label">Your email address</label>
<input type="text" name="email" class="form-control" id="email" value="{{ Request::old('email') ?: '' }}">
@if ($errors->has('email'))
<span class="help-block">{{ $errors->first('email') }}</span>
@endif
</div>
<div class="form-group{{ $errors->has('username') ? ' has-error' : '' }}">
<label for="username" class="control-label">Your desired username</label>
<input type="text" name="username" class="form-control" id="username" value="{{ Request::old('username') ?: '' }}">
@if ($errors->has('username'))
<span class="help-block">{{ $errors->first('username') }}</span>
@endif
</div>
<div class="form-group{{ $errors->has('password') ? ' has-error' : '' }}">
<label for="password" class="control-label">Your desired password</label>
<input type="password" name="password" class="form-control" id="password" value="">
@if ($errors->has('password'))
<span class="help-block">{{ $errors->first('password') }}</span>
@endif
</div>
<div class="form-group">
<button type="submit" class="btn btn-default">Sign up</button>
</div>
<input type="hidden" name="_token" value="{{ Session::token() }}">
</form>
}谢谢安德鲁马林科夫的回答
protected $fillable = [
'username', // <-- Was not set correctly in my model!
'email',
'password',
'first_name',
'last_name',
'location',
];
protected$filleble=[
'用户名',//您是否确保您的username
字段在您的雄辩模型中声明为可填充?显然,我刚刚输入了'name',这已经修复,可以确认它正在工作!谢谢!:D
protected $fillable = [
'username', // <-- Was not set correctly in my model!
'email',
'password',
'first_name',
'last_name',
'location',
];