Did you set a fillable or guarded property on the member model?
Also, the updated_at is only updated whenever there is a change on the model. If there is no change, the datetime is not updated.
I have a simple piece of code which retrieves a model, sets a boolean field on the model to true and then saves the model. Normally this works fine. However, occasionally the field is not changed but the updated_at is changed.
$member = $this->member::findByCode((int) Auth::user()->name);
$member->funds()->sync($newFunds);
$member->made_choice = true;
$member->save();
(Yes, I know the authorised user's name is an integer, not my choice).
I cannot, for the life of me, work out where to start debugging. made_choice is defined as a boolean in the migration and there is no $casts on the model. There is no consistency as to when this fails and when it succeeds. No errors are appearing in the logs. Nothing to indicate what is happening.
$table->boolean('made_choice')->default(false)->after('member_code');
I'm sure I'm missing something obvious but what?
Please or to participate in this conversation.