How to make filament to trim form input?
Laravel uses TrimStrings middleware to automatically trim all form string inputs. However, I noticed that filament allows data to be saved with trailing spaces. How do I enable filament to trim form inputs?
Solution:Jump to solution
```php
// its by design from Livewire to skip TrimStrings
// in the source code here
vendor/livewire/livewire/src/Mechanisms/HandleRequests/HandleRequests.php
// in the boot method they have...
2 Replies
Solution
You will have to handle it outside Filament/Livewire, for example you can use the method configureUsing on the field for example
Which you use in your AppServiceProvider boot method
and same applies to the rest of the fields like TextArea etc hope that helps