Also it would be quite inefficient to calculate counts like this. It’s better to make it part of the query using an aggregate (withCount ) for example.
Expose group of fields as a new single reusable field
Hmm yes so for example i have this form
$form->schema([
MonetaryInput::make('price'),
])
$form->schema([
MonetaryInput::make('price'),
])
which would ideally result in
{
"price": "£123.00"
}
{
"price": "£123.00"
}
or
{
"price": {
"currency": "gbp",
"amount": 12300,
}
}
{
"price": {
"currency": "gbp",
"amount": 12300,
}
}
I know the latter is possible with statePath now but would like to know if option one is also possible (and recommend). Maybe using the hydrate... methods?