Error while doing update in the Standard

Asked

Viewed 31 times

-2

When trying to perform the following update:

        $criterios = Criterios::find(1);

        $criterios->update(
                    [
                        'criterios' => $request->criterios
                        'editado_por' => $user->id
                    ]
                );

I get the error: Datetime::__Construct(): Failed to parse time string (Thu 23 Apr 16:40:16 2020) at position 13 (:): Unexpected

The Insert is done correctly, I have no mutator, follow my model:

class Criterios extends Model
{
        protected $table = 'criterios';

        protected $fillable = ['criterios', 'editado_por']
}
  • You can’t tell with just this code.

1 answer

-1

Try the following.

$criterios = Criterios::find(1);
$criterios->criterios = $request->get('name_do_input');
$criterios->editado_por = $request->get('name_do_input');
$criterios->save();

Browser other questions tagged

You are not signed in. Login or sign up in order to post.