Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

campo calculado #1

Open
hillgp opened this issue Oct 21, 2023 · 2 comments
Open

campo calculado #1

hillgp opened this issue Oct 21, 2023 · 2 comments

Comments

@hillgp
Copy link

hillgp commented Oct 21, 2023

No description provided.

@hillgp
Copy link
Author

hillgp commented Oct 21, 2023

ola gostaria de saber como consigo calcular dois campos do formulario
ex.

Filament\Forms\Components\TextInput::make('valor_do')
->disabled() // O campo 'valor_do' será desativado e calculado automaticamente.
->computed(function ($record) {
return $record->er + $record->el;
}),

este sem resultados tambem

Filament\Forms\Components\TextInput::make('valor_do')
->disabled()
->default(function ($record) {
return $record->er + $record->el;
}),

qual a solucão ?

@leandrocfe
Copy link
Owner

->formatStateUsing(function ($record) {
return $record->er + $record->el;
})

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants