Laravel Snippet: Auto Trim Fields From Database in Model
This is a quick snippet of code that you insert in your model if you need to automatically trim the values from all model fields using the hydrate method, provided by the Illuminate\Database\Eloquent\Model .