Get parent data inside a repeater
If you are in a repeater section - and you need to reference a number the user entered in the "header" portion (i.e. the order or invoice at the top) such as a markup% or weight or something for purposes of a calculation (maybe in ->afterStateUpdated or ->state), how does one reference that data that is outside of the repeater section?
2 Replies
I found the syntax: apparently you need to use '..' to reference parent, and it's like a directory, so referencing a parent item from a repeater looks like $get('../../variable_in_parent')!
Good to know! I think you could also access it by retrieving the livewire instance:
https://filamentphp.com/docs/3.x/forms/advanced#injecting-the-current-livewire-component-instance