Datalist, autosuggestions without JavaScript

I love that browsers get more and more native controls so that we developers don’t have to worry about JavaScript libraries. Autocompletion is a pattern that all web users are...

Laravel rate limiter does not limit

While trying out Laravel 8 and the new rate limiter, I could not get it to work on my developer machine. It turns out that the rate limiting mechanism is...

Flatten Eloquent collection to array with key and value

If you have a result from Eloquent which is a collection where every value is on it’s own row, you can use mayWithKey() create an array in a specific...

MySQL and sorting umlauts like Swedish åäö

utf8_general_ci will sort Ö with O and you should use the utf8_swedish_ci instead. That will have the correct sorting order, which (IIRC) is that ÅÄÖ go to the end of...

Troubleshoot downloads

Most libraries like PHPSpreadSheet seems to use PHP buffer. And depending on your PHP configuration some warnings or errors could interfer with the output. Let’s examine the output before...