PHPackages                             sterxa/laravel-ddd-helper - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. sterxa/laravel-ddd-helper

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

sterxa/laravel-ddd-helper
=========================

Useful Artisan commands to help Laravel apps that utilizes Domain Driven Design.

1.2.2(5y ago)0131MITPHPPHP ^7.4

Since Sep 24Pushed 5y agoCompare

[ Source](https://github.com/sterxa/laravel-ddd-helper)[ Packagist](https://packagist.org/packages/sterxa/laravel-ddd-helper)[ Docs](https://github.com/sterxa/laravel-ddd-helper)[ RSS](/packages/sterxa-laravel-ddd-helper/feed)WikiDiscussions master Synced 3w ago

READMEChangelogDependencies (7)Versions (9)Used By (1)

Laravel DDD Helper Commands
---------------------------

[](#laravel-ddd-helper-commands)

The project was originally forked from

The `sterxa/laravel-ddd-helper` package adds a handful of useful Artisan commands to your Laravel application. It assumes you are utilizing the Domain Driven Design approach.

It is heavily inspired by the DDD approach mentioned in [this great article](https://stitcher.io/blog/organise-by-domain) by Brent from Spatie.

In addition, it assumes that you have a separate namespace for your domain. Take a look of this example of the autoload section from a composer.json file:

```
{
    ...
    "autoload": {
        "psr-4": {
            "App\\" : "app/App/",
            "Domain\\" : "app/Domain/",
            "Support\\" : "app/Support/"
        },
       ...
    }
}

```

Basic Usage
-----------

[](#basic-usage)

The package comes with a handful of commands out of the box.

**Actions**

Generate a new Action using the `domain:action` command:

```
php artisan domain:action CreateUserAction -d User
```

*NOTE: You may use the -d|--domain option to specify the given domain for the action. If you do not specify a domain, it will be generated within the default namespace. You may configure that in the config file.*

**Data Transfer Objects**

Generate a new Data Transfer Object class using the `domain:dto` command:

```
php artisan domain:dto UserData -d User
```

**Enums**

Generate a new Enum class using the `domain:enum` command:

```
php artisan domain:enum UserType -d User
```

**Events**

Generate a new Event class using the `domain:event` command:

```
php artisan domain:event UserCreated -d User
```

**Models**

Generate a new Eloquent model class using the `domain:model` command:

```
php artisan domain:model User -d User
```

**Observers**

Generate a new Observer class using the `domain:observer` command:

```
php artisan domain:observer UserObserver -d User
```

**Policies**

Generate a new Policy class using the `domain:policy` command:

```
php artisan domain:policy UserPolicy -d User
```

**Rules**

Generate a new Rule class usign the `domain:rule` command:

```
php artian domain:rule CustomEmailRule -d User
```

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

[](#installation)

You can install the package via composer:

```
composer require sterxa/laravel-ddd-helper
```

The package will automatically register itself.

You can optionally publish the config file with:

```
php artisan vendor:publish --tag="ddd-helper-config"
```

Testing
-------

[](#testing)

```
composer test
```

Security
--------

[](#security)

If you discover any security issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [All contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

26

—

LowBetter than 41% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

7

Last Release

2100d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/dbc4bbc2045f3a5347d73ffab28926e85149208e8406a9e00cb9989160c2c19d?d=identicon)[tsonevpe](/maintainers/tsonevpe)

---

Top Contributors

[![petyots](https://avatars.githubusercontent.com/u/14016592?v=4)](https://github.com/petyots "petyots (20 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/sterxa-laravel-ddd-helper/health.svg)

```
[![Health](https://phpackages.com/badges/sterxa-laravel-ddd-helper/health.svg)](https://phpackages.com/packages/sterxa-laravel-ddd-helper)
```

###  Alternatives

[firefly-iii/data-importer

Firefly III Data Import Tool.

7965.8k](/packages/firefly-iii-data-importer)[markwalet/nova-modal-response

A Laravel Nova asset for Modal responses on an action.

17818.7k](/packages/markwalet-nova-modal-response)[nfse-nacional/nfse-php

This is my package nfse

1523.1k](/packages/nfse-nacional-nfse-php)[tomshaw/electricgrid

A feature-rich Livewire package designed for projects that require dynamic, interactive data tables.

119.2k](/packages/tomshaw-electricgrid)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
