Let's talk about code

Hi, I’m Michiel. I’m a professional programmer for more than a decade. I work mostly in PHP and javascript, mainly in Magento and Laravel. I write testable code and love to give testing workshops to you and your colleagues. You can hire me for freelance/consulting jobs.

Contact me Hire me

Blog

Valet Plus+, Magento 2

Running Magento 2.4.0 on Valet+

Valet+ has support for ElasticSearch 6.8, but Magento 2.4.0 requires you to install a newer version, 7.6 or higher. How do you handle that with Valet+
Magento 2, Magento 2 local environment

Save environment specific settings in your env.php file

This scenario has happened to me too many times: I downloaded a backup of a site (stripped from customer data of course), import the database in my local environment and open the site. At this moment you will get redirected to the site where the data originates from and you figure you need to change some URLs.
Magento 2, 2 factor authentication

How to disable 2-factor authentication in Magento 2.4.0

In previous versions of Magento it was possible to enable 2 factor authentication (2fa) for admin users. In Magento 2.4.0 Adobe decided to kick the security up a notch and force 2-factor authentication for all users in the backend. Now 2-factor authentication is great as it adds another layer of security in your webshop, but it can also be too much. Especially when you work by following OTAP where you have multiple environments.
Magento 2, Continuous Integration, Integration test, Testing

Testing Magento 2 extensions in a continuous integration pipeline

As you might know i like to write code that is tested. Now, writing tests in Magento can be quite hard, but running your tests in a continuous integration pipeline can be even harder. Even more harder is it to test standalone Magento 2 extensions in a continuous integration pipeline.
Magento 2, Coding tips, Controller

Where to place code in a Magento 2 module?

Magento 2 has a few building blocks for you when building a module, but placing your code in the right place can be hard. Here i try to sum up where you should place your code.
Magento 2, Dependency Injection, di.xml, Coding tips

Using di.xml to improve your code quality

In this article i'm going to show you a technique that i like to apply in some of the larger Magento 2 module i write.
Magento 2, Queue

Leveraging the queue in Magento 2 in a (semi) simple way

Using queus is a good way to move some heavy processing to the background of your application. It makes sure expensive operations don't come in the way of the experience of your end user. But configuring and using queues can be a time consuming process. The method described here does help you get things up and running fast.
Controller, Magento 2

Working with temporary files in Magento 2

Recently i had to create an export in Magento 2 using PhpSpreadsheet. I created the sheet and added my data, but them i did hit a bump in the road: how do i download this file?
Continuous Integration, Integration test, Magento 2, Magento 2 testing, Open source

Revive your Magento integration tests

In my day to day job as a freelancer i get to work on quite a few different Magento setups. Now as i try to practice Test Driven Development (TDD) wherever i can, i kept hitting the same bump in the road: when you have an installation that is around for some time, there is a big chance that the integration test setup is broken.
Composer, Laravel Nova, Laravel, Open source

Introducing Laravel Email on Event

Recently i was working on a Laravel project and i needed to add some sales emails: Onboarding when someone registers, an e-mail when an order was placed. That kinds of things.