You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When changing the input of the customer_email field. I will need to query DB to get members.email and then fill in other fields depending on it. For example:
Text::make(__('Organization name'),'organization_name')
->rules(['nullable', 'max:50'])
->placeholder(__('Placeholder string limit 50'))
->dependsOn(['customer_email'], function (Text$field, NovaRequest$request, FormData$formData) {
if ($formData->customer_email) {
$member = (newMemberRepository())->findByEmail($formData->customer_email);
if ($member){
$field->setValue($member->organization_name);
}
}
})
->onlyOnForms(),
The problem is I have a lot of fields like this. So this will create a duplicate query to do one thing get $member.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
In my
Order
resource. I have acustomer_email
field like this:When changing the input of the
customer_email
field. I will need to query DB to getmembers.email
and then fill in other fields depending on it. For example:The problem is I have a lot of fields like this. So this will create a duplicate query to do one thing get
$member
.Is there any way to do it properly?
Beta Was this translation helpful? Give feedback.
All reactions