I'm trying to persist data from the client to my database and I have a trouble with the timestamp.
public function post(UpdateRequest $request){
$update = new UpdateEvent();
$update->src = $request->get('src');
$update->title = $request->get('title');
$update->sapo = $request->get('description');
$update->created_at = $request->get('created_at');
$update->img = $request->get('image');
$update->save();
return view('update.notification');
}
I'm getting the following exception:
InvalidArgumentException in Carbon.php line 582:
Unexpected data found.
Trailing data
Can you help me?
When a column is considered a date, you may set its value to a UNIX timestamp, date string (Y-m-d), date-time string, and of course a DateTime / Carbon instance, and the date's value will automatically be correctly stored in your database:
Source.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With