Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Hexagonal Maker Bundle Laravel Package

adrienlbt/hexagonal-maker-bundle

Symfony MakerBundle extension that scaffolds Hexagonal Architecture use cases. Generates a UseCase class plus Request/Response DTOs and a Presenter interface in a clean Domain folder structure, with optional configurable layer paths.

View on GitHub
Deep Wiki
Context7

Hexagonal Maker Bundle

The Hexagonal Maker Bundle is a code generator for Symfony that automates the use case creation process for Hexagonal Architecture. It extends Symfony's Maker Bundle to generate properly structured use cases, requests, responses, and presenter interfaces.

⚙️ Installation

Add the bundle with composer:

composer require --dev adrienlbt/hexagonal-maker-bundle

If Symfony Flex doesn't add the bundle automatically, activate it manually:

// config/bundles.php
return [
    // ...
    AdrienLbt\HexagonalMakerBundle\HexagonalMakerBundle::class => ['dev' => true]
];

That's it! The bundle is now ready to use. No additional configuration steps are required.

⚙️ Configuration (Optional)

You can customize the default paths for your hexagonal architecture layers:

# config/packages/hexagonal_maker.yaml
hexagonal_maker:
  application_path: 'Application'  # Default
  domain_path: 'Domain'            # Default
  infrastructure_path: 'Infrastructure'  # Default

📖 Usage

Create Use Case

Run the following command and follow the interactive prompts:

bin/console make:hexagonal:usecase

This will generate:

  • UseCase class in Domain\UseCase\{folder}\{Name}
  • Request class in Domain\Request\{folder}\{Name}Request
  • Response class in Domain\Response\{folder}\{Name}Response
  • PresenterInterface in Domain\API\{folder}\{Name}PresenterInterface

Example

bin/console make:hexagonal:usecase User CreateUser

# This generates:
# - Domain/UseCase/User/CreateUser.php
# - Domain/Request/User/CreateUserRequest.php
# - Domain/Response/User/CreateUserResponse.php
# - Domain/API/User/CreateUserPresenterInterface.php

🏗️ Generated Structure

The make:hexagonal:usecase command generates the following files:

src/
├── Domain/
│   ├── UseCase/{folder}/        # Use case implementations
│   ├── Request/{folder}/        # Request DTOs
│   ├── Response/{folder}/       # Response DTOs
│   └── API/{folder}/            # Presenter interfaces

🤝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

📄 License

This bundle is released under the MIT License.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
octoberrain/html
octoberrain/extension
octoberrain/exception
octoberrain/contracts
frankyso/ipaymu
3mdikram/worldmoneywords
snowsoft/config
itmosoft/laravel-subscriptions
larva/laravel-ai-qwen
diephp/sequences
users-au/socialite-provider
twidpay/twid-logger
mrnewport/laravel-plaid
mrnewport/laravel-repo
mrnewport/laravel-docsign
mrnewport/laravel-stow
mrnewport/laravel-flow
mrnewport/laravel-priceable
mrnewport/laravel-nestedterms
fredmeng/laravel-apidoc-generator