PHPackages                             lava83/laravel-ddd - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Framework](/categories/framework)
4. /
5. lava83/laravel-ddd

ActiveLibrary[Framework](/categories/framework)

lava83/laravel-ddd
==================

A comprehensive toolkit providing foundational building blocks for implementing Domain-Driven Design (DDD) patterns in Laravel 12+ applications. This package offers battle-tested base classes, contracts, and infrastructure components to help you build scalable, maintainable domain-driven applications.

v0.5.11(3w ago)01511[1 issues](https://github.com/lava83/laravel-ddd/issues)MITPHPPHP ^8.4CI passing

Since Jun 28Pushed 3w agoCompare

[ Source](https://github.com/lava83/laravel-ddd)[ Packagist](https://packagist.org/packages/lava83/laravel-ddd)[ Docs](https://github.com/lava83/laravel-ddd)[ GitHub Sponsors](https://github.com/Lava83)[ RSS](/packages/lava83-laravel-ddd/feed)WikiDiscussions main Synced 2w ago

READMEChangelog (10)Dependencies (64)Versions (33)Used By (0)

Laravel DDD
===========

[](#laravel-ddd)

[![Latest Version on Packagist](https://camo.githubusercontent.com/57de1a360b06e94961b985de27465c7150f1a3facb512e45d7bb44936f768c7b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6c61766138332f6c61726176656c2d6464642e737667)](https://packagist.org/packages/lava83/laravel-ddd)[![License](https://camo.githubusercontent.com/26219f952cc760694969f11a510e6e33420b6b8930f939c10942313e72a57dcf/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6c61766138332f6c61726176656c2d6464642e737667)](LICENSE.md)

> Work in progress. The public API may still change between releases.

Foundational building blocks for Domain-Driven Design in Laravel. The package ships battle-tested base classes and contracts — Entities, Aggregates, Value Objects, Repositories, Entity ↔ Model Mappers and Domain Events — so your applications can focus on the domain instead of the plumbing.

It enforces a strict layer separation (`Domain`, `Application`, `Infrastructure`) and gives you optimistic locking, automatic domain-event dispatching on save, and a set of ready-made value objects out of the box.

Requirements
------------

[](#requirements)

- PHP 8.4+
- Laravel 13 (`illuminate/contracts` `^13.0`)

Installation
------------

[](#installation)

```
composer require lava83/laravel-ddd
```

The service provider and the `LaravelDdd` facade are registered automatically through Laravel package discovery. There is no configuration or migration to publish — you build your own domains on top of the provided base classes, as shown below.

Quick start
-----------

[](#quick-start)

The example models a single `Article` aggregate with a `Title` value object and persists it through a mapper and a repository. It is the smallest slice that still exercises every core building block: a value object, an aggregate, an Eloquent model, a mapper and a repository.

Suggested structure inside a consuming application:

```
app/
├── Domain/
│   └── Blog/
│       ├── Article.php
│       ├── Contracts/
│       │   └── ArticleRepository.php
│       └── ValueObjects/
│           ├── ArticleId.php
│           └── Title.php
├── Infrastructure/
│   ├── Mappers/
│   │   └── ArticleMapper.php
│   ├── Models/
│   │   └── ArticleModel.php
│   └── Repositories/
│       └── EloquentArticleRepository.php
└── Providers/
    └── BlogServiceProvider.php

```

### 1. Value objects

[](#1-value-objects)

An identity and a small, self-validating value object. Both are immutable.

```
