Toughoj
170
3
Laravel

Disable touches on firstOrCreate (laravel 5.5)

Posted 1 month ago by Toughoj

I've got two related models :

1-Answer (consists of 'answer_id' and 'text' attributes in addition to 'created_at' and 'updated_at')

2-AnswerBody

AnswerBody model has:

protected $touches = ['Answer'];

I intend to create an AnswerBody without touching the related Answer in some cases. how do I disable touches on create() or firstOrCreate() on AnswerBody ?

Please sign in or create an account to participate in this conversation.