Fill repeater on createView
I'm facing an issue while implementing an invoice creation . I'm using the Repeater component to display order items (commandeItems)
Here's a summary of what I have set up:
I have a Commande model with a hasMany relationship to CommandeItem.
I have an Invoice model with a hasMany relationship to CommandeItem
I'm using CreateInvoice, which extends Filament's CreateRecord to create a new invoice.
In CreateInvoice, I fetch a specific order with its associated articles (commandeItems) and attempt to pre-fill them in the form using mapCommandeItemsForForm().
Despite this, the Repeater for commandeItems stays empty when I open the form.
then i fill my form
4 Replies
an dthis my mapCommandeItemsForm()
thenks for your help
an this my repeater on InvoiceResource
plz any help commande mean order
first thing don't mix two languages, it's too hard to read. use english.
as for the problem do a
dd($this->commande->commandeItems)
in your mapCommandeItemsForForm method to check if get anything
also, when using livewire wouldn't rely on the request to get some variable@krekas dd($this->mapCommandeItemsForForm());
so it's already an array? then map should throw error as it's not a collection