Form builder does not allow decimals. (?)
Neither dot or comma is accepted - chrome@mac
Any solution?
16 Replies
can you provide all code for
TextInput
Here is the whole resource file
Migration
$table->decimal('salary_from', 10, 2);
$table->decimal('salary_to', 10, 2);
What do you mean exactly? Sould I add min-max validation to enable decimals?
ah wait.. it's because of
numeric
see here https://www.php.net/manual/en/function.is-numeric.php
More here https://laravel.com/docs/11.x/validation#rule-numeric
I may be wrong tho.. 🤣I've seen docs, filamnet suggests using ->numeric() for numeric fields, my problem is not being able to save decimals
I dont think you got me
What about this input mode https://filamentphp.com/docs/3.x/forms/fields/text-input#setting-the-html-input-mode
tbh I am so confused rn
Same - input mode is 'decimal' by default when using ->numeric()
Just check and it's working fine
Forms\Components\TextInput::make('order')->numeric(),
i see u dd() something does it acrtually work? not returning validation error?
Actually my database is not setup to support
decimal
let me experiment with string
typeWorking fine
I don't have any idea in your case.. sorry
Can we see your model too? Decimals are supported.
Nothing custom in model class, decimal(10,2) column.
I decided to use text input with masking.