定制 morphling-dev/3d 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

morphling-dev/3d

Composer 安装命令:

composer require morphling-dev/3d

包简介

Morphling Coding 3D (Domain Driven Design) Scaffolding Generator

README 文档

README

Latest Version on Packagist Total Downloads License

Morphling 3D is an architectural framework for Laravel that enables you to build scalable, maintainable, and structured applications using Domain-Driven Design (DDD) and Hexagonal Architecture.

It is designed for systems where business complexity matters — such as ERP, financial systems, and multi-module enterprise applications.

Why Morphling 3D Exists

As applications grow, traditional Laravel structures often lead to:

  • Bloated controllers and services
  • Mixed responsibilities across layers
  • Difficult-to-maintain business logic
  • Inconsistent patterns between modules

Morphling 3D addresses these issues by enforcing a clear architectural structure and predictable development flow.

Core Principles

Morphling 3D is built around a few strict principles:

  • Separation of Concerns Each layer has a single responsibility and must not leak into others.

  • Explicit Application Flow Every request follows a clear path:


Request → DTO → UseCase → Domain → Repository

  • Domain-Centric Design Business rules live inside the Domain layer, not in controllers or infrastructure.

  • Consistency Across Modules Every module follows the same structure, making large systems easier to navigate and maintain.

What Morphling 3D Provides

Morphling 3D is not just a generator. It provides a structured system for building applications:

  • Modular Architecture Each feature is isolated into its own module with clear boundaries.

  • Layer Enforcement Domain, Application, Infrastructure, and Delivery layers are clearly separated.

  • DTO and Mapper Pattern Ensures data integrity when moving across layers.

  • Auto Discovery Modules automatically register routes, providers, and migrations.

  • Shared Kernel Includes reusable components such as:

  • ApiResponse

  • BaseUseCase

  • BaseModel

  • HttpStatus

Module Structure

Every module follows a consistent 4-layer architecture:

modules/
└── {ModuleName}/
  ├── Application/        # DTOs, UseCases
  ├── Domain/             # Entities, Value Objects, Enums, Interfaces
  ├── Infrastructure/     # Models, Repositories, Mappers
  └── Delivery/           # Controllers, Requests, Resources, Routes

Installation

Install via Composer:

composer require morphling-dev/3d

Run the installer:

php artisan 3d:install

Register the modules namespace:

"autoload": {
    "psr-4": {
        "App\\": "app/",
        "Modules\\": "modules/"
    }
}

Then run:

composer dump-autoload

Getting Started

Artisan Commands

Morphling 3D provides a comprehensive set of Artisan commands to manage modules and generate structured code across all layers.

Core Commands

Initialize and manage the Morphling 3D environment:

php artisan 3d:install

Module Management

Create, inspect, and manage modules:

php artisan 3d:new {ModuleName}
php artisan 3d:delete {ModuleName}
php artisan 3d:list
php artisan 3d:discover

Module Operations

Run module-specific operations such as migrations, routes, and testing:

php artisan 3d:migrate
php artisan 3d:seed
php artisan 3d:route:list
php artisan 3d:test

Application Layer

Generate application-level components:

php artisan 3d:make-dto
php artisan 3d:make-usecase

Domain Layer

Generate core business logic components:

php artisan 3d:make-entity
php artisan 3d:make-vo
php artisan 3d:make-enum
php artisan 3d:make-interface
php artisan 3d:make-service

Infrastructure Layer

Generate technical and persistence-related components:

php artisan 3d:make-model
php artisan 3d:make-repo
php artisan 3d:make-mapper
php artisan 3d:make-migration
php artisan 3d:make-seeder
php artisan 3d:make-factory
php artisan 3d:make-event
php artisan 3d:make-listener
php artisan 3d:make-job
php artisan 3d:make-notification
php artisan 3d:make-observer
php artisan 3d:make-external
php artisan 3d:make-provider

Delivery Layer

Generate interface and HTTP-related components:

php artisan 3d:make-controller
php artisan 3d:make-request
php artisan 3d:make-resource
php artisan 3d:make-route
php artisan 3d:make-view

Command Philosophy

Morphling 3D commands are designed to enforce architectural consistency. Each generated file follows predefined conventions aligned with the 4-layer architecture.

Commands are not just code generators — they help ensure your application remains maintainable, scalable, and aligned with best practices.

Configuration

You can customize base paths and namespaces in config/3d.php:

return [
    'base_path' => base_path('modules'),
    'base_namespace' => 'Modules',

    'namespaces' => [
        'use-case'     => 'Application/UseCases',
        'entity'       => 'Domain/Entities',
        'value-object' => 'Domain/ValueObjects',
        'repository'   => 'Infrastructure/Repositories',
    ],
];

When to Use Morphling 3D

Morphling 3D is best suited for:

  • Enterprise applications
  • ERP systems
  • Financial systems with approval workflows
  • Systems with complex business rules
  • Multi-team development environments

It may be unnecessary for small CRUD-based projects.

Links

Contribution

Contributions are welcome. Please open a Pull Request to the main branch.

License

MIT License

Created by Indra Ranuh & Morphling Coding

morphling-dev/3d 适用场景与选型建议

morphling-dev/3d 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 4 次下载、GitHub Stars 达 0, 最近一次更新时间为 2026 年 03 月 31 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 morphling-dev/3d 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 morphling-dev/3d 我们能提供哪些服务?
定制开发 / 二次开发

基于 morphling-dev/3d 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 4
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 20
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-03-31