How to string to boolean in PHP

Sometimes digesting JSON you may need to cast a string to boolean. Without trying yourself there is a function for this in PHP. This is the way to do it:...

Wildcard subdomains on Cloudflare with PHP and API-tokens

I have been using Cloudflare’s excellent DNS-service for managing my domains. Free SSL-certificates and anti-DDoS services are added benefits. However, proxied wildcard subdomains are not available except on the enterprise...

Laravel Echo and broadcasting from a package

While implementing Laravel Echo for a package I found an small problem. By default Laravel Echo looks in App\Events for events, and therefor I could not listen to the...

ImagickException – cache resources exhausted

It says i all. Increase the memory limits for Imagick and you should be fine. However, it does not help to just add more memory in php.ini, instead you...

Laravel Eloquent Query log

Sometimes it can be tricky to narrow down a faulty relationship. There is a enableQueryLog() which can help you in cases like this DB