PHPackages                             reizucodes/laravel-domain-toolkit - 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. reizucodes/laravel-domain-toolkit

ActiveLibrary[Framework](/categories/framework)

reizucodes/laravel-domain-toolkit
=================================

Laravel toolkit for layered architecture with repositories, services, DTOs, and domain scaffolding.

v2.0.4(3mo ago)17↓90%[1 issues](https://github.com/reizucodes/laravel-domain-toolkit/issues)MITPHPPHP ^8.1

Since Mar 2Pushed 3mo ago1 watchersCompare

[ Source](https://github.com/reizucodes/laravel-domain-toolkit)[ Packagist](https://packagist.org/packages/reizucodes/laravel-domain-toolkit)[ RSS](/packages/reizucodes-laravel-domain-toolkit/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (1)Dependencies (2)Versions (9)Used By (0)

Laravel Domain Toolkit
======================

[](#laravel-domain-toolkit)

A Laravel toolkit that scaffolds a layered architecture using repositories, services, DTOs, and domain-oriented generators.
It helps enforce separation of concerns and promotes scalable, testable application design.

---

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

[](#requirements)

- PHP 8.1 or higher
- Laravel 9, 10, 11, 12 and 13

---

Compatibility
-------------

[](#compatibility)

This package supports:

- Laravel 9.x
- Laravel 10.x
- Laravel 11.x
- Laravel 12.x
- Laravel 13.x (Experimental)

---

Supporting Links
----------------

[](#supporting-links)

> Resources related to repository patterns, service layers, and domain-oriented design.

### Architecture &amp; Domain Design

[](#architecture--domain-design)

-
-
-

### Laravel Foundations

[](#laravel-foundations)

-
-
-

---

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

[](#installation)

### Step 1: Install via Composer

[](#step-1-install-via-composer)

```
composer require reizucodes/laravel-domain-toolkit
```

---

### Step 2: Register the Service Provider (If Needed)

[](#step-2-register-the-service-provider-if-needed)

Laravel supports package auto-discovery, so this step is usually unnecessary.

If auto-discovery is disabled, manually register the service provider:

#### Laravel 10 and Below

[](#laravel-10-and-below)

Add to `config/app.php`:

```
'providers' => [
    BlaiseBueno\LaravelDomainToolkit\DomainToolkitServiceProvider::class,
],
```

#### Laravel 11 and Above

[](#laravel-11-and-above)

Add to `bootstrap/providers.php`:

```
return [
    BlaiseBueno\LaravelDomainToolkit\DomainToolkitServiceProvider::class,
];
```

---

### Step 3: Publish Toolkit Resources

[](#step-3-publish-toolkit-resources)

```
php artisan vendor:publish --tag=laravel-domain-toolkit
```

This will publish:

```
app/Repositories/BaseRepository.php
app/Repositories/Interfaces/EloquentInterface.php
app/Providers/RepositoryServiceProvider.php

stubs/domain-toolkit/
├── repository.stub
├── repository-interface.stub
├── service.stub
└── dto.stub

```

Publishing installs required base classes and stub templates used by the generators.

The published stubs allow you to customize how repositories, services, and DTOs are generated.

You must publish the toolkit before using the generators.

Use `--force` to overwrite existing files:

```
php artisan vendor:publish --tag=laravel-domain-toolkit --force
```

---

Repository Bindings
-------------------

[](#repository-bindings)

Repository bindings are handled through:

```
app/Providers/RepositoryServiceProvider.php

```

### Laravel 11 and Above

[](#laravel-11-and-above-1)

No manual registration is required.
Laravel automatically loads providers inside the `app/Providers` directory.

### Laravel 10 and Below

[](#laravel-10-and-below-1)

Register the provider in `config/app.php`:

```
App\Providers\RepositoryServiceProvider::class,
```

---

Smart Class Resolution
----------------------

[](#smart-class-resolution)

If your application defines:

- App\\Support\\ServiceReturn

The toolkit will automatically use your existing implementation.
Otherwise, it falls back to the package default.

---

Commands
--------

[](#commands)

All commands are registered automatically via the package.
No manual registration is required.

---

Service Return
--------------

[](#service-return)

The toolkit provides a `ServiceReturn` helper to standardize responses from the service layer.

It encapsulates:

- data
- errors
- HTTP status codes

Example:

```
return ServiceReturn::success($data);

return ServiceReturn::clientError('Invalid input');
```

You can convert responses to JSON:

```
return $serviceReturn->toJsonResponse();
```

If your application defines:

```
App\Support\ServiceReturn

```

it will be used when generating services via `make:service` instead of the package default.

---

Usage
=====

[](#usage)

The toolkit provides generators for common architecture components.

---

Generate a Repository
---------------------

[](#generate-a-repository)

```
php artisan make:repository User
```

Creates:

```
app/Repositories/UserRepository.php
app/Repositories/Interfaces/UserInterface.php

```

Also registers the binding in:

```
app/Providers/RepositoryServiceProvider.php

```

---

Generate a Service
------------------

[](#generate-a-service)

```
php artisan make:service User
```

Creates:

```
app/Services/UserService.php

```

---

Generate a DTO
--------------

[](#generate-a-dto)

```
php artisan make:dto User
```

Creates:

```
app/DTO/UserDto.php

```

---

### Nested DTOs (Recommended)

[](#nested-dtos-recommended)

You can generate DTOs inside folders using slash notation:

```
php artisan make:dto Auth/User
```

Creates:

```
app/DTO/Auth/UserDto.php

```

Namespace:

```
App\DTO\Auth\UserDto
```

---

### DTO Naming Rules

[](#dto-naming-rules)

The generator automatically:

- Converts names to StudlyCase
- Ensures a single `Dto` suffix
- Prevents duplicate suffixes

Examples:

InputOutput`User``UserDto``UserDto``UserDto``user_dto``UserDto``Auth/UserDTO``Auth/UserDto`---

### Notes

[](#notes)

- Nested paths (`Auth/User`) are the standard way to define folders
- Folder structure is automatically reflected in the namespace
- Existing files will prompt for overwrite unless `--force` is used

---

Generate a Full Domain Scaffold
-------------------------------

[](#generate-a-full-domain-scaffold)

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

Creates:

```
app/Models/User.php
app/Http/Controllers/UserController.php
app/Repositories/UserRepository.php
app/Repositories/Interfaces/UserInterface.php
app/Services/UserService.php

```

This command orchestrates the generators and sets up a complete domain layer.

---

Stub Customization
------------------

[](#stub-customization)

All generator templates are published to:

```
stubs/domain-toolkit/

```

You may modify these files to customize generated classes.

---

License
-------

[](#license)

This package is open-source and available under the MIT license.

###  Health Score

33

—

LowBetter than 72% of packages

Maintenance62

Regular maintenance activity

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

 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 ~5 days

Total

6

Last Release

91d ago

Major Versions

v1.0.0 → v2.0.02026-03-26

PHP version history (2 changes)v1.0.0PHP ^7.4|^8.0

v2.0.0PHP ^8.1

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/92848228?v=4)[John Blaise Bueno](/maintainers/reizucodes)[@reizucodes](https://github.com/reizucodes)

---

Top Contributors

[![reizucodes](https://avatars.githubusercontent.com/u/92848228?v=4)](https://github.com/reizucodes "reizucodes (34 commits)")

---

Tags

laravelscaffoldingrepository patterndtoservice layerclean architecturedomain toolkit

### Embed Badge

![Health badge](/badges/reizucodes-laravel-domain-toolkit/health.svg)

```
[![Health](https://phpackages.com/badges/reizucodes-laravel-domain-toolkit/health.svg)](https://phpackages.com/packages/reizucodes-laravel-domain-toolkit)
```

###  Alternatives

[laravel/laravel

The skeleton application for the Laravel framework.

84.5k62.4M1.0k](/packages/laravel-laravel)[laravel/octane

Supercharge your Laravel application's performance.

4.0k24.7M204](/packages/laravel-octane)[unopim/unopim

UnoPim Laravel PIM

10.3k2.2k](/packages/unopim-unopim)[nasirkhan/laravel-starter

A CMS like modular Laravel starter project.

1.4k2.7k](/packages/nasirkhan-laravel-starter)[ecotone/laravel

Ecotone for Laravel — CQRS, Event Sourcing, Sagas, Durable Workflows, and Outbox on top of Laravel Queue, via PHP attributes.

21313.7k3](/packages/ecotone-laravel)[codewithdennis/larament

Larament is a time-saving starter kit to quickly launch Laravel 13.x projects. It includes FilamentPHP 5.x pre-installed and configured, along with additional tools and features to streamline your development workflow.

3861.7k](/packages/codewithdennis-larament)

PHPackages © 2026

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