Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Browse all series

Modular Laravel

In this course, we'll discuss the modular monolith, or - if you want to sound fancy - a module-oriented architecture. A modular monolith provides a fantastic middle-ground between the simplicity of a traditional monolithic architecture, and some of the benefits you might encounter within a microservice-based architecture. Curious to learn more? Let's get going!

Progress

Series Info

Episodes
25
Run Time
3h 31m
Difficulty
Advanced
Last Updated
Jan 4, 2024
Version
Latest

Series Episodes

  1. Episodes (25)
    1. Introduction

      Let's begin by discussing what we're going to build, as well as the particular challenges we want to tackle along the way.
    2. Splitting the Application

      Let's learn how to logically divide our application into different modules.
    3. Setting Up Service Providers

      In this episode, you will learn how to set up service providers for each of your modules.
    4. Where to Put Automated Tests

      If we have different modules, where do we store the tests? In the usual place? Inside each module? Let's figure that out.
    5. Setting Up Model Factories

      Let's explore some potential options for where to store our model factories.
    6. Install the IDE Helper

      The Laravel IDE Helper is a fantastic package. Let's learn how to configure it to work with modules.
    7. Building a Basic Checkout Flow

      Let's start by constructing the most basic version of a checkout.
    8. Introducing Data Transfer Objects

      Let's learn how we can use DTOs to pass data around different modules in our application.
    9. Introducing a Payment Model

      Let's add a Payment abstraction to make our application more complete.
    10. Extracting Behavior to Actions

      Moving on, let's see how we might use actions (self-handling commands) to encapsulate and orchestrate behavior in our application.
    11. Payment Actions and Database Transactions

      Let's extract payment logic into a separate class and introduce database transactions.
    12. Encapsulating Behavior Into Models

      Let's learn how to make our models a little bit richer by encapsulating important behavior.
    13. Temporal Coupling and Events

      Let's next review what problems temporal coupling introduces, and how we can leverage an event system to deal with it.
    14. Consolidating Data Into Dtos

      Let's see how we can use DTOs to consolidate data and enable stable contracts.
    15. Where We Are

      Let's take a quick break and see what we have started with and what we currently have built.
    16. Introducing Interfaces and Enabling Polymorphism

      Let's learn how we can use interfaces at the entry-points of our modules to enable polymorphism.
    17. Automatically Loading Views and Components

      Laravel doesn't know where to look for views and components within a custom directory structure. Let's figure out how to configure that.
    18. Tooling

      The Laravel ecosystem provides many tools to help us build modular applications. Let's review a handful of them together in this episode.
    19. Vertical Slices

      Let's see what vertical slices are and how we can implement them in an application.
    20. Grouping by Type

      The standard way to build Laravel applications is by grouping components by type. Let's see how to implement that within modules.
    21. How to Fake Boundaries

      Let's learn how to replace different components that interact with our modules by fake versions in our tests.
    22. Applying Templates to Our Mailables

      As we've been working, some mistakes were understandably made. Let's fix our mailables to load Blade templates.
    23. An Event-driven Approach - Part 1

      Let's learn how to re-architect our checkout to use events, and what differences that would make in our application.
    24. An Event-driven Approach - Part 2

      In this lesson, we'll review a simple implementation of an event-driven approach.
    25. Wrapping Up

      It's time for us to say goodbye. If you've made it this far, thanks so much for coming along. I hope you got a lot out of this course.

Continue Learning