The latest courses, articles, and resources, sent to your inbox weekly.

By clicking „Subscribe” you consent to sending our newsletter to the indicated e-mail address. Your personal data will be processed in accordance with our Privacy Policy.
Event Sourcing in Laravel


Event Sourcing in Laravel

Event Sourcing in Laravel is a brand new 2021 course by Brent Roose from SPATIE. Contains ebook, videos and demo code for a shopping cart in Laravel.


0 out of 5 stars

0 reviews

Get started

Course information

  • Level
  • Lessons
  • Duration
    2 total hours
  • Language
  • Transcripts
  • Downloadable
  • Book
  • Certificate
  • Access
  • Released at
  • Revised at


Brent Roose

Developer Advocate

0 reviews of courses

To say that Brent Roose is passionated by PHP is an understatement. He moderates /r/php and already wrote two books: Laravel Beyond CRUD and Front Line PHP. He's a Developer Advocate at Jet Brains and blogs at

See more (3) courses by Brent Roose

About this course

The knowledge in this course is built from the years of experience our team has building large, robust applications.

Domain oriented Laravel

Most principles in this course are based on best practices in domain driven design, and hexagonal architectures. These proven principles will be our guide throughout building large Laravel applications. Some of the theoretical topics we'll cover include:

• The basic idea of domain groups explained
• Practically applying DDD and hexagonal architecture principles in Laravel projects
• When to use domains, and when to stick to Laravel's default structure
• Thinking of "data" and "functionality" as two first-class citizens of your codebase
• The state pattern to model complex, state-specific, flows
• The difference between application and domain code
• Writing robust code by using types and static analysis

In practice

We're nothing with only theory if we can't apply it in practice. This course focuses highly on combining the two: in each episode we'll do live coding, and build a project from the ground up:

• Keeping model classes small and clean
• Structuring complex queries
• Passing data around in a structured way using Data Transfer Objects
• How to make code reusable by using actions
• Improving code clarity by using meaningful names
• Keep controllers light by using view models
• Adding behaviour to collections
• Testing actions, Data Objects and model-related classes
• Using enhanced test factories to seed data for every scenario
• Using PhpStorm's refactoring tools to manage classes and namespaces
• Scaffold different types of classes using PhpStorm templates

For everyone

While the main focus of this course lies on larger projects, there are many principles in it that you can apply today, in your own projects, even when they aren't large at all. We've used many of these principles ourselves, also in our smaller projects:

• Data objects always have a significant impact, regardless of project size
• Whatever type of project, you will be dealing with controllers, so view models will improve your workflow
• Actions are a structured solution for code that would otherwise end up spread across the project
• Even the smallest MVC app also deals with querying models, understanding Laravel's query builders will be an asset
• Most principles in this course can be cherry-picked by you to solve your problems. Nothing is set in stone: there are no hard rules, only guidelines


0 out of 5 stars

Based on 0 reviews

Review data

Share your thoughts

If you’ve used this course, share your thoughts with other students

Write a review

Recent reviews

Ready to learn? Start your 2023 challenge today.