Categories
General

How to move a column in a Laravel migration

This post could have also be titled “How to move a column in MySQL” or “How to move a column with SQL”… I guess you get it. Sometimes you just have to ship it and ship it now™ and, in the heat of the moment, you could oversee the order of some database columns. Or […]

Categories
General

Learn how to import a function() in PHP

TIL*¹ you can import just a function in a .php file, like we do with classes. It works from PHP 5.6+, so there’s no weird compatibility issue. And it’s dead simple. Here’s an example from Safe PHP, specifically let’s say we want to use the safer*² version of json_decode. Pay attention at how this allows […]