LaravelPackages.net
Acme Inc.
Toggle sidebar
innovartingsas/laravel-hexagonal

Hexagonal architecture for Laravel

272
4
V2.1
About innovartingsas/laravel-hexagonal

innovartingsas/laravel-hexagonal is a Laravel package for hexagonal architecture for laravel. It currently has 4 GitHub stars and 272 downloads on Packagist (latest version V2.1). Install it with composer require innovartingsas/laravel-hexagonal. Discover more Laravel packages by innovartingsas or browse all Laravel packages to compare alternatives.

Last updated

Laravel Hexagonal

Latest Version on Packagist Total Downloads Software License

Laravel package that allows modifying the folder structure proposed by Laravel in its initial installation by a structure based on Hexagonal Architecture.

Install

composer require innovartingsas/laravel-hexagonal --dev

Implementation

In the root project execute artisan command

php artisan hexagonal:install --folder={NAME_FOLDER} --app-namespace={APP_NAMESPACE}

Or use the short form

php artisan hexagonal:install -f {NAME_FOLDER} -a {APP_NAMESPACE}

The namespace is automatically added to the psr-4 key of the compose.json file.

All files and folders found in the app folder will be moved to the Infrastructure folder found inside the folder defined in the --folder option of the package installation command.


File structure created by the package

  • App Folder Name
    • Application
    • Domain
      • Entities
        • Traits
          • AddProps.php
          • DeleteProps.php
          • Serializable.php
        • BaseEntity.php
        • EntityId.php
    • Infrastructure
      • Console
      • Exceptions
      • Http
      • Models
      • Providers

Todo List

  • [X] Add CommandBus Contract
  • [X] Add Command and Handler Interface for UseCases
  • [X] Add custom Container Class
  • [X] Add binding for a CommandBus and Container Class
  • [X] Add Contracts folder inside Domain folder
  • [X] Add Repositories folder inside Domain folder
  • [X] Add commands for the creation of entities, factories, repositories and use cases.

License

The Laravel Hexagonal Package is open-sourced software licensed under the MIT license.

Comments