Trim strings in Laravel automatically

Is there a way to trim all data that goes in the database? I thought there was a trim middleware that would do this, but it’s still possible to save data to the database with spaces before and after strings. I use Jetstream and Livewire if that matters.

Read more here:

Content Attribution

This content was originally published by SeaBass at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: