Sponsored:

Your customers are already searching—if you’re not online, they’re choosing someone else. A polished website builds trust, works 24/7, and turns interest into action. With RoseHosting, you don’t need code, a big budget, or weeks of waiting: pick a design, add your content, and launch fast.
Stop being invisible. Start owning your digital storefront today—build your WordPress site now.
Author:
Source
Leading and trailing whitespaces. The bane of normalized data everywhere. It seems like a constant task that needs to be performed on incoming user data. When working with Laravel, I use the TrimStrings middleware. Calls PHP’s built-in trim function on all string values for the request query and input values – including JSON! While working on my project WhiskeyDex, I noticed how mobile device keyboards always add trailing whitespace when using the autocomplete functionality. This, in turn, meant user-created data will end up with trailing whitespaces. I started to just quick-fix in the single instance and realized it should be solved once and for all.