My most popular blog posts 2020

These last years I have been using my blog as a kind of public notebook. If there is a problem and I find the solution, I usually make a post...

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...