Autofill fields from url
hey, is there a way to autofill fileds from the url?
I have created this action which links to the Create Page of a resource, I want to have a few fields prefilled, depending on the action.
Here is what i tried, want to fill the field named iban with the value DE90BLABLA
9 Replies
You should be able to access the data via the Livewire component:
->action(fn ($livewire) => do stuff with your component)
but in that context
$livewire
is the current component and i want to modify data on the page I'm linking to. The Action is on the TransactionResource
and I want to prefill data in the form of the AssigmentResource
Ah sorry. I thought you want to auto fill from a response. In that case. Pass your data as query params and retrieve them on
mount()
of the pageah okay so no native way to do it, thank you very much!
Nope. Maybe it's not mount but
mutateDataBeforeFill()
where you should add the dataIf i close this post, will this still be available to see for others? or what should I do, never worked with these help threads
I'll close it. It will be moved to the old posts for search.
ah okay
it needs to be done in
mount()
, mutateDataBeforeFill()
is only called on the EditRecord Page
got it working thanksYep it will, I've closed it for you now. It just marks it as old. And it'll still be openable.