Issue with Incomplete Replication of Related Records in Repeater Field v4 beta
In my use case, I have a Quote model that has a hasMany relationship with a Passenger model. On the Filament form, I use a Repeater field to manage the passengers, and the data is stored in a separate passengers table using the hasMany and belongsTo Eloquent relationships.
When I use the replicate() method to duplicate a quote, the main Quote record is copied successfully, but the associated Passenger records are not replicated along with it. This results in an incomplete clone, where the newly created quote has no passengers attached.
Expected Behavior:
When replicating a Quote, all related Passenger records should also be duplicated and linked to the new Quote instance.
What I’ve Tried:
I’ve confirmed that the relationship is properly defined in both models and that the passengers are saved correctly under normal operations. However, during replication, they are omitted unless I manually loop through and copy them, which feels like a workaround.
Request:
Is there a clean, recommended way (especially within Filament context) to replicate related records like those used in a Repeater field?
Should this be handled manually post-replication, or is there native Filament or Laravel support for this use case?
Let me know if you need any code snippets or further information.
0 Replies