I wanted to do update but do not need to go into edit
so i use this button to do the update
when i click the green button, the value of "new" is going to change
this is my blade:
<form class="btn-group" action="{{ route('perjanjians.konfirmasi', ['id' => $item->id]) }}" method="POST">
@csrf
@method('PATCH')
<label class="btn btn-success text-center">
<button type="submit" class="btn btn-success btn-xs">Konfirmasi</button>
</label>
</form>
This is my Controller for update:
public function update_konfirmasi(Request $request, Perjanjian $perjanjian)
{
// dd($perjanjian);
$request->validate([
'schedule_doctor_id' => 'nullable',
'email' => 'nullable',
'no_tlp' => 'nullable',
'tanggal' => 'nullable',
]);
$perjanjian->nama_lengkap = $request->get('nama_lengkap') ;
$perjanjian->email = $request->get('email') ;
$perjanjian->no_tlp = $request->get('no_tlp') ;
$perjanjian->tanggal = $request->get('tanggal') ;
$perjanjian->is_confirm = 'confirm';
dd($perjanjian);
$perjanjian->save();
return back();
}
but when i click, the data from $perjanjian variables its gone, but the is_confirm is changed
where i do something wrong when updating?

