PHPackages                             phpsquad/domain-maker - 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. phpsquad/domain-maker

ActivePackage

phpsquad/domain-maker
=====================

Domain Driven Design for Laravel made easy

v1.0.1(3y ago)883.1k↓25%17[1 issues](https://github.com/phpsquad/domain-maker/issues)MITPHP

Since Apr 22Pushed 3y ago5 watchersCompare

[ Source](https://github.com/phpsquad/domain-maker)[ Packagist](https://packagist.org/packages/phpsquad/domain-maker)[ RSS](/packages/phpsquad-domain-maker/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (2)Dependencies (2)Versions (3)Used By (0)

Domain Maker for Laravel
========================

[](#domain-maker-for-laravel)

[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)

The Why
-------

[](#the-why)

Domain Driven Design helps us to organize our thoughts and to build apps using logical grouping of our code.

If you've ever worked on a large laravel project you know how that model directory can grow so large that your ability to find things becomes hampered.

I was inspired by this article  from Freek at Spatie to refactor to Domains. I love it! It makes it so much easier to focus on a specific issue without the need to traverse the entire code base. If I'm working on Payments, I live in the payments Domain.

I soon realized refactoring to DDD is pretty straight forward, but the typically wonderful development experience I've grown used to with laravel left a bit to be desired.

Also, what if I know my project is going to be large, and I want to get a head start and begin development using DDD?

That's why this package exists.

How can Domain Maker help you?
------------------------------

[](#how-can-domain-maker-help-you)

Domain Maker makes Domain Driven Development easier in Laravel by providing you with a set of commands to create the scaffolding and boilerplate laravel normally provides but tailored to a Domain Oriented Structure.

- Helpful Commands to:
    - Automatically scaffold a new Domain with the often needed directories and classes
    - create controllers
    - create route files
    - create models
    - create repositories
- Automatic Routes discovery (no need to register routes in the RouteServiceProvider)
- Automatic View discovery (no need to add view path to config)

### All Domain Maker Commands are under the prefix domain.

[](#all-domain-maker-commands-are-under-the-prefix-domain)

```
 domain:make:controller        Create a new controller class
 domain:make:domain            Create a new Domain
 domain:make:routes            Create a new routes for domain
 ...
```

Install
-------

[](#install)

```
composer require phpsquad/domain-maker
```

Usage
-----

[](#usage)

### Create new Domain

[](#create-new-domain)

```
php artisan domain:make:domain
```

If this is the first domain the Domains directory will be created under app/Domains along with the specified domain.

```
Domains
└── Media
    ├── Exceptions
    ├── Http
    │   ├── Controllers
    │   │   ├── VimeoController.php
    │   │   └── YoutubeController.php
    │   ├── Middleware
    │   └── Requests
    │       └── YoutubeRequest.php
    ├── Jobs
    │   └── YoutubeSync.php
    ├── Models
    │   └── Youtube.php
    ├── Repositories
    │   └── YoutubeRepository.php
    ├── resources
    │   ├── css
    │   ├── js
    │   └── views
    │       └── youtube-home.blade.php
    ├── routes
    │   ├── Media.php
    │   ├── Vimeo.php
    │   └── Youtube.php
    └── Services

```

### Routing

[](#routing)

A standard route file is created when you create a domain via the `domain:make:domain` command.

> Routes are discovered automatically via the DomainRouteServiceProvider

To create subsequent route files use:

```
domain:make:routes
```

For example, if I have a "Payments" domain, and I'd like to group my Stripe Routes I'd run the command like so:

```
domain:make:routes Payments Stripe
```

### Repositories

[](#repositories)

A repository with standard CRUDs can easily be generate by using the `domain:make:repository`.

```
domain:make:repository
```

Using the "Payments" domain again to demonstrate, we can use the command as follows:

```
domain:make:repository Payments PaymentRepository Payment
```

### Stubs

[](#stubs)

Public stubs will be used as a default. If stubs are unpublished, backups are contained in the package.

There are package specific stubs that you may publish to override (i.e., routes.stub)

> If you don't need to make changes to the stubs it's not necessary to publish them.

```
php artisan vendor:publish --tag=domain-stubs
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Credits
-------

[](#credits)

- [Richard Rohrig](https://github.com/phpsquad)
- [All Contributors](https://github.com/phpsquad/domain-maker/contributors)

Security
--------

[](#security)

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

License
-------

[](#license)

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

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity36

Limited adoption so far

Community18

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 87.9% 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 ~235 days

Total

2

Last Release

1250d ago

### Community

Maintainers

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

---

Top Contributors

[![rohrig](https://avatars.githubusercontent.com/u/45824492?v=4)](https://github.com/rohrig "rohrig (29 commits)")[![Julius-Bendt](https://avatars.githubusercontent.com/u/22844949?v=4)](https://github.com/Julius-Bendt "Julius-Bendt (2 commits)")[![drpshtiwan](https://avatars.githubusercontent.com/u/6718949?v=4)](https://github.com/drpshtiwan "drpshtiwan (1 commits)")[![hakimzulkufli](https://avatars.githubusercontent.com/u/42469039?v=4)](https://github.com/hakimzulkufli "hakimzulkufli (1 commits)")

---

Tags

domain-driven-designlaravelphplaravel

### Embed Badge

![Health badge](/badges/phpsquad-domain-maker/health.svg)

```
[![Health](https://phpackages.com/badges/phpsquad-domain-maker/health.svg)](https://phpackages.com/packages/phpsquad-domain-maker)
```

###  Alternatives

[slowlyo/owl-admin

基于 laravel、amis 开发的后台框架~

61214.2k26](/packages/slowlyo-owl-admin)[erag/laravel-disposable-email

A Laravel package to detect and block disposable email addresses.

226102.4k](/packages/erag-laravel-disposable-email)[highsolutions/eloquent-sequence

A Laravel package for easy creation and management sequence support for Eloquent models with elastic configuration.

121130.3k](/packages/highsolutions-eloquent-sequence)[glhd/linen

21135.6k](/packages/glhd-linen)[api-platform/laravel

API Platform support for Laravel

59126.4k6](/packages/api-platform-laravel)[interaction-design-foundation/laravel-geoip

Support for multiple Geographical Location services.

17221.0k3](/packages/interaction-design-foundation-laravel-geoip)

PHPackages © 2026

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