Skip to content

Artisan command package to handle your Domain Driven Design project that suitable with Laravel base structures, made for comer of Domain Driven Design and advanced.

License

Notifications You must be signed in to change notification settings

besfortoruci/diamond-console

 
 

Repository files navigation

KoalaFacade Logo

Test Passing Laravel PHP Badge

Artisan command package to handle your Domain Driven Design project that suitable with Laravel base structures, made for comer of Domain Driven Design and advanced.

Table of Contents

  1. Documentation
  2. Contribution

Documentation


Installation

Install Diamond Console with composer

 composer require koalafacade/diamond-console

then after Diamond Console installed run command below to set up your project. The command below will generate namespace in composer and base directory structures.

 php artisan diamond:install

Commands


domain:make:action GenerateProfileAction User

Command for generate an action inside your domain directory.

Arguments

Name Description
Name Action class name
Domain Domain Name

Options

Name Description
--force Force create the action

domain:make:enum Role User

Command for generate an enum to your domain directory.

Arguments

Name Description
Name Enum class name
Domain Domain Name

Options

Name Description
--force Force create the enum

domain:make:dto RoleData User

Command for generate a Data Transfer Object with plain PHP to your domain directory.

Arguments

Name Description
Name Data Transfer Object class name
Domain Domain Name

Options

Name Description
--force Force create the Data Transfer Object

application:migration create_user_table

Command for generate a migration file

Arguments

Name Description
Name Table Name

Options

Name Description
--table to generate a migration with purpose edit table
--create to generate a migration with purpose to create a table

domain:make:model User User

Command for generate a model inside Shared in Domain directory, all model will store shared folder since another domain probably consume the model at the same time.

Arguments

Name Description
Name Model name
Domain Domain Name

Options

Name Description
-m or --migration Create migration file when model created
-f or --factory Create factory class when model created this option will generate two files,
Factory contract and Factory concrete
--force Force create the enum

infrastructure:make:factory RoleFactory User

Command for generate a factory class, this command would generate two files :

  1. Factory concrete at Infrastructure/{DomainName}/Database/Factories
  2. Factory Contract at Domain/Shared/Contracts/Database/Factories

The bottom of reason why we did this, cause Factories is an Infrastructure component then Domain can't consume any stuff inside infrastructure, so you can do Dependency Injection at Service Provider for resolve this one.

Arguments

Name Description
Name Factory Name
Domain Domain Name

Options

Name Description
--force Force create the factory

infrastructure:make:mail ApprovedUser User

Command for generate a Mail class. this command will generate Mail class into Infrastructure side because this class purpose is store to external.

Arguments

Name Description
Name Mail name class
Domain Domain Name

Options

Name Description
--force Force create the Mail class

Contribution

Thanks for consideration to contribute to Diamond Console of Domain Driven Design you can go through to Contribute Area

About

Artisan command package to handle your Domain Driven Design project that suitable with Laravel base structures, made for comer of Domain Driven Design and advanced.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PHP 100.0%