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


Laravel, Testing, Queue

Testing jobs in Laravel

Recently someone in a Slack channel i’m a member of asked the following:I want to test if job A fires job B, but how do you test something like that?Niek ten HoopenEspecially when the queue is set up to be run asychronus this seems impossible to test. The normal flow would be something like this:
Composer, Continuous Deployment, GIT, Valet Plus+, WordPress

Manage WordPress using Composer

It took me a while before i finally found the right combination, but i now have a full working setup where is manage my WordPress dependencies using Composer. Before this i used to have a local copy of my WordPress site where i run all updates, and then committed all code that was changed so i could get deployed. I knew this was dirty, but i've tried on multiple occasions to find a better solution but my Google fu failed me.
Magento 2, Quick Tip

Retrieving orders using the Magento 2 API

Recently i had to fetch order information using the Magento 2 API, and to be more specific: The latest orders with a specific status. This turned out to be a bit harder than i initially expected. Magento has some pretty good documentation on this subject, but i still needed a little bit tinkering to get the right result.
Magento 2, Layout XML, Quick Tip

Conditionally hide or show a block in Magento 2

Somehow i only found about this little gem only recently. In your layout xml you can use the ifconfig parameter to hide or show block depending on your configuration. It works as following.
Continuous Integration, Integration test, Magento, Magento 2, Testing

Debugging the Magento 2 integration test setup

You might have been at the same point where i have been a few times: You want to start with integration tests on an existing Magento 2 store. You follow the steps to setup your IDE, start the first test and wait. After a while you get one of these nasty non descriptive errors:
Freelancing, Shopify, Laravel

My Shopify app got approved!

So in a previous blogpost i already told that i was working on my own product. Well this is a Shopify app and last Friday it finally got approved to their app store. In the blogpost from januari i thought it would released within a few weeks, but it took a bit longer. This was on one hand due to having to wait for the Shopify approval process, on the other side due to lack of time from my side. But it's finally here.
Cloudflare, Laravel, Laravel Forge, WordPress

Wordpress, Cloudflare & Laravel Forge

This always bites me when setting up a Wordpress site on Laravel Forge: You get a redirect loop. This article is therefor mostly written for myself.
Controller, Magento 2, Quick Tip

Download a file in a controller in Magento 2

Today i had to create a file download from a Magento 2 controller. I turnes out that this is quite simple. Now, it's good to know that there are 2 options here.
Control Alt Delete.nl

Control Alt Delete.nl is moving!

So a few months ago i was doubting about my freelance career. In the mean time things become more clear for me and i have found some new clients who gave me some freedom in my work, for which i'm very thankful. The last ~6 months i was working mostly from home. This is great and has some big benefits, but can be lonely at times. There are also a lot of distractions at times. So i decided it was time to look for an official office.
Magento 2

How to check if a user is logged in in Magento 2

Recently i had to do something very simple: Show a button in the product listing page of a Magento 2 depend if the use was logged in or not. Just do a $session->isLoggedIn() one would say, right? It turns out that this is way more from the truth than i initially though.