【发布时间】:2020-03-19 17:15:33
【问题描述】:
我正在尝试更新 (date_of_completion) 字段,但它显示错误,如果我从模型中删除受保护的 $dates 它可以工作
错误
A four digit year could not be found
Data missing
型号
<?php
namespace App;
use Illuminate\Notifications\Notifiable;
use Illuminate\Contracts\Auth\MustVerifyEmail;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Database\Eloquent\Model;
class Student extends Model
{
protected $dates = ['date_of_join','date_of_completion','dob'];
protected $table = 'student_lists';
protected $fillable = ['student_name', 'student_registration_id', 'date_of_join', 'student_phone_no', 'student_photo','date_of_completion','dob' ];
}
输入视图
<div class="col-md-3">
<input type="date" name="date_of_completion" class="form-control form-control-lg" id="date_of_completion" required>
</div>
【问题讨论】:
-
你能告诉我你编辑日期的控制器部分吗?
标签: laravel laravel-5 laravel-5.6