今は私の予定を削除することはできますが、保存することはできません。laravelに予定を保存する
これは私の削除機能である:
public function destroy($id)
{
$appointment = Appointment::find($id);
$appointment->delete();
return redirect('/appointments');
}
そしてこれは私のそれが更新されないです何らかの理由で機能
public function update($id)
{
$save_appointment = Appointment::find($id);
$save_appointment->save();
return redirect('/appointments');
}
を保存しています。 id
は100%正確です。私は間違って何をしています。あなたは本当に重要な何かが欠けている
protected $fillable = [
'gender', 'options', 'user_id',
];
/**
* The attributes that should be hidden for arrays.
*
* @var array
*/
protected $hidden = [
'password', 'remember_token',
];
あなたは何を更新していますか? –