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
- Episodes (25)
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.Splitting the Application
Let's learn how to logically divide our application into different modules.Setting Up Service Providers
In this episode, you will learn how to set up service providers for each of your modules.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.Setting Up Model Factories
Let's explore some potential options for where to store our model factories.Install the IDE Helper
The Laravel IDE Helper is a fantastic package. Let's learn how to configure it to work with modules.Building a Basic Checkout Flow
Let's start by constructing the most basic version of a checkout.Introducing Data Transfer Objects
Let's learn how we can use DTOs to pass data around different modules in our application.Introducing a Payment Model
Let's add a Payment abstraction to make our application more complete.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.Payment Actions and Database Transactions
Let's extract payment logic into a separate class and introduce database transactions.Encapsulating Behavior Into Models
Let's learn how to make our models a little bit richer by encapsulating important behavior.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.Consolidating Data Into Dtos
Let's see how we can use DTOs to consolidate data and enable stable contracts.Where We Are
Let's take a quick break and see what we have started with and what we currently have built.Introducing Interfaces and Enabling Polymorphism
Let's learn how we can use interfaces at the entry-points of our modules to enable polymorphism.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.Tooling
The Laravel ecosystem provides many tools to help us build modular applications. Let's review a handful of them together in this episode.Vertical Slices
Let's see what vertical slices are and how we can implement them in an application.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.How to Fake Boundaries
Let's learn how to replace different components that interact with our modules by fake versions in our tests.Applying Templates to Our Mailables
As we've been working, some mistakes were understandably made. Let's fix our mailables to load Blade templates.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.An Event-driven Approach - Part 2
In this lesson, we'll review a simple implementation of an event-driven approach.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.
