Software engineer and content creator Martin Joo has spent much of his journey tinkering around with PHP, Laravel and APIs. A staunch believer in domain-driven design and test-driven development, Martin’s books about Laravel have made him an influential name in the community. His writings include titles such as Microservices with Laravel, Laravel Eloquent Recipes, and Proper API Design with Laravel.
We’re delighted to have the chance to pick Martin’s brains today, as he talks us through his professional career, shares insights about his books and writing process, and explains why he’s never going back to conventional shared hosting after trying out managed cloud hosting.
Shahzeb: Hi Martin, it’s lovely to have you for this interview. Could you please tell our readers about yourself? Any insights you’d like to share about your professional career?
Martin: Hi! It’s nice to be here! So I’ve been a developer since 2012, when I was 19 years old. Since then, I’ve mainly worked on larger B2B applications. Right now, I’m working for a startup in Hungary. We’re developing an HR, PR, and kind of a social engagement application for big corporations. Communicating correctly with tens of thousands of employees is a real challenge for these companies, so we’re trying to solve that issue. And you know, we’re facing the everyday challenges of a larger, complex project with many features.
Shahzeb: Can you share your journey with Laravel? Any relatable experience from your career you find interesting and would like to share with our audience?
I think my most valuable experience was when I was trying to figure out how to develop maintainable, larger projects but keep the simplicity that comes with Laravel. I tried so many things; I applied so many patterns; I implemented some very overengineered architectures. So after months (if not years) of failed attempts, I decided to adopt the best parts of domain-driven design and incorporate them into Laravel projects while keeping the framework’s simplicity. The best feedback was when I registered on Twitter and saw that other people from the community were applying very similar solutions. I’m talking about names like Freek Van Der Herten, Brent, Steve King, and regular developers like you and me.
Another great experience was when I finally did acknowledge that feature and API tests were superior in a high-level business application. Before that, I was a “hardcore” unit-tester. “Isolation” was probably my favorite buzzword. But after I saw some of Jeffrey Way’s and Adam Wathan’s videos about feature testing, I never looked back.
Shahzeb: Martin, you also wrote the book Domain-Driven Design with Laravel. Could you tell us a bit about this book? Who should read this book and how does it benefit developers?
Martin: Finding the “perfect architecture” and developing the “perfect project” was always like the “holy grail” to me. I worked on 8, 10, or 10+ years old projects, so keeping the architecture clean was huge. And as I said earlier, I tried so many things. DDD was very promising. But it was super complex and, to be honest, a poor choice for Laravel. I’m talking about “the DDD,” with very strict rules and probably 25+ complicated, abstract terms, such as “Polysemy” or “MultipleCanonicalModels.”
I thought these concepts were good but presented academically and resulted in code that didn’t fit Laravel. These guys came from the Java or the C# world, where things were different and more “bureaucratic.”
As a result, I consistently applied these concepts in a much simpler way with only a handful of strict rules. And they worked. They worked well in teams with junior and medior developers as well.
So one day, I asked myself: “why not write a book about it and share it with others?” And finally, I did write the book. I believe that it’s best for intermediate and senior developers who already have decent experience but want to have better architecture.
Shahzeb: What kind of research do you do, and how long do you spend researching before you begin writing a book?
Martin: The primary research I did for this book was the sample application. In every book I write, I build a sample project that shows the reader how they can apply the concepts in a real-world application. I wanted to build something complicated for this book that takes advantage of domain-driven design. First, I thought it would be something like Twitter. Everyone knows Twitter, and this is where my audience comes from, so it would have been a great example. But as it turned out, Twitter is pretty simple. I mean, from a domain model perspective (not from an algorithm or recommendation system point-of-view).
So my next idea was email marketing, or email service provider. I think every developer knows MailChimp, Drip, or ConvertKit, because the business often has an audience, and we need to integrate with these providers. Or, in the worst case, we need to write our own newsletter service or module (hi!). And they have some very complicated features (e-mail sequences or automation, for example), so I thought it would be the perfect example to build in the book.
After that, I spent about one or two weeks copying the main features of ConvertKit and modeling the whole system. As it turned out, it was the perfect example!
One of the packages of the book also contains the source code and a case about a portfolio and dividend tracker app. Fortunately, it was an easy choice because I already had that project. It was my personal portfolio tracker app (after all, I’m a software developer, and I like wasting my time writing unnecessary applications). And I thought it was a perfect opportunity to make a case study of its data modeling and overall design.
However, as it was a personal project with a private Github repository, initially, I had my Gmail address and all of my holdings and financial transactions in the database seeder. After I deleted it, I checked the whole codebase at least four times to ensure everything was ready to share.
Shahzeb: You have extensive knowledge of Laravel development. What motivated you to become a Laravel web developer? Who were your mentors and inspirations in this journey?
Martin: Thank you, but I have a lot of areas where I could improve! My primary motivation was Laravel’s simplicity. I know it’s a cliché, but it’s true, and it’s a critical feature of a framework. Before Laravel, I worked mainly with Kohana, Yii, and a bit of Symfony. For example, Symfony is a great framework, in my opinion, and a foundation of Laravel, but using Symfony feels so “noisy” and “bureaucratic” compared to Laravel.
Of course, another big motivation is the vast ecosystem. I mean, Laravel has a first-party service or package for every problem. Just think about Forge or Breeze! And the number of 3rd party packages is also huge. As a bonus, we also have Spatie 🙂 And if you take a step further, you find a massive community on Twitter, for example.
Another great thing about Laravel is that a company maintains it. So the chance of Laravel getting abandoned by its maintainers is almost zero (like Kohana or a dozen other frameworks got abandoned).
And last but not least, there are a lot of great content creators in the Laravel community. Just to name a few:
Basically, they were my mentors when I was a junior developer, and they still are nowadays. And, of course, some of my coworkers.
Shahzeb: Would you like to tell our readers about some of the best Laravel projects you’ve worked on?
Martin: I would say the current project I’m working on is pretty cool. First of all, it has an incredible amount of features. You can do anything from creating communities, posting social updates, managing tickets and holidays, or handling the cafeteria. The number of features gives you a great number of challenges. For example, avoid spaghetti code when there are some connected features or complicated requests about an older feature.
Another challenge is that part of the codebase was written by another team a few years ago. And unfortunately, clean code or test coverage was not their priority. But I don’t have a problem testing and refactoring legacy code, so it’s always a good challenge. However, I like a good balance between new features and hacking legacy code.
Shahzeb: Which type of web hosting would you prefer? In your opinion, what are the benefits of hosting a site on a managed solution provider rather than conventional shared hosting?
Martin: I use managed providers exclusively. They literally give me everything I need, PHP, MySQL, Redis, etc. I’m not the biggest DevOps guy in the world, so having an expert team who knows how to manage and maintain these components is something I’m happy to pay!
I also love that nowadays, there are a lot of tasks that can be done using our browser instead of spinning up a terminal and running complicated Linux commands.
I don’t think I’d ever go back to conventional shared hosting, to be honest.
Shahzeb: What do you think about managed hosting solutions like Cloudways that provide an optimized PHP stack and offer Laravel framework in one click with features to deploy their web apps?
Martin: Having cloud providers with managed solutions is one of the most incredible things that has happened to our industry in the last few years!
With Cloudways, you can literally provision a new server in like 5 minutes. And it installs everything that a Laravel application needs. But more importantly, after you have your application running, you can deploy a version with one click. It’s that easy.
A few years earlier, when I didn’t have Linux or ops experience, fighting with servers and the terminal was always the primary reason I hadn’t launched too many side projects. It was a burden to me. Nowadays, when we have several great providers, launching a project is not a “mini-project on the next weekend” anymore. It’s a one-hour task in your lunch break!
Shahzeb: What do you enjoy doing when you’re away from your laptop?
Martin: I play guitar in a rock band, and I love music. Usually, in summer, we always have some gigs to play and a few beers to drink after the shows 🙂
I also love doing sports. I have always loved martial arts and have tried a few in recent years, but boxing is my favorite. However, nowadays, I’m planning to try out thai box.
Other than that, I love to hang out with family and friends.
Shahzeb: Whom should we interview next & why?
- Steve King
- Matt Kingshott
- Povilas Korop
- Nuno Maduro
Shahzeb: Martin, I’m sure many people have taken notes. I’m also sure they’d love to see a picture of your workstation if you’d like to share one!
Martin: Sorry, but my workstation’s pretty boring, actually. So I’d not share it if it’s okay 🙂
Shahzeb: Sure, Thank you once again, Martin Joo!
Start Creating Web Apps on Managed Cloud Servers NowEasy Web App Deployment for Agencies, Developers and E-Commerce Industry.
Shahzeb is a Digital Marketer with a Software Engineering background, works as a Community Manager — PHP Community at Cloudways. He is growth ambitious and aims to learn & share information about PHP & Laravel Development through practice and experimentation. He loves to travel and explore new ideas whenever he finds time. Get in touch with him at [email protected]