I have a problem only when updating (not creating) I got this error :
Illuminate\Database\QueryException SQLSTATE[22007]: Invalid datetime format: 1366 Incorrect integer value: 'on' for column
alleshops.eshops.payathomeat row 1 (SQL: updateeshopssetpayathome= on,paywithcard= on,eshops.updated_at= 2021-01-17 05:33:03 whereid= 10)
Here is my controller:
public function edit_eshop(Eshop $eshop,Request $request){
if ($request->method() == 'POST'){
$eshop->title = $request->get('title');
$eshop->link = $request->get('link');
$eshop->telephone = $request->get('telephone');
$eshop->email = $request->get('email');
$eshop->payathome = $request->get('payathome');
$eshop->paywithcard = $request->get('paywithcard');
$eshop->tags = $request->get('tags');
if($eshop->save()){
echo "Το eshop δημιουργήθηκε επιτυχώς.";
return redirect('/eshops');
};
};
return view('edit_eshop', ['eshop' => $eshop]);
}
similar questions didn't help me unfortunatelly
payathomein your form is a checkbox? is this field supposed to be a datetime field in the database? - lagbox