Repeater data record didnt appear in relationship
I have supplierRestock that hasMany restockItem (relationship is defined in supplierRestock model), so i use repeater and try to edit some data inside but i cant find the data only from repeater.
I dump the data in create record with handleRecordCreation but find nothing from tableRepeater. when i try remove the relationship() it appear.
3 Replies
All fields with
->relationship()
saves directly to the relationship and remove the data afterwards, because it can't be saved to the model. What's the issue you are having?
If you want to mutate the data, there are methods like ->mutateRelationshipDataBeforeCreate
i want to modify the SupplierRestockItem creation manually like this but the relationship() keep giving me undefined array key $data['restockItems']
because restockItems is a relationship I suspect.
The relationship should already be created