KoalaFacade / diamond-console

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.
https://koalafacade.github.io/packages/diamond-console/
MIT License
64 stars 7 forks source link

When I run commands the files created are not in src directory #74

Closed Mutahhar closed 1 year ago

Mutahhar commented 1 year ago

Hi,

I followed the instructions here (https://koalafacade.github.io/packages/diamond-console/) to install and configure the package in a Laravel 10 app. I used following command to setup the package php artisan diamond:install --skip-refactor.

When I run commands like php artisan application:make:data-transfer-object RoleData User to generate domain related files/classes, the files are not created in the src directory. Instead, it places the files in Laravel's app directory. According to my understanding, the files should be created in the src directory.

Is there anything I'm overlooking?

pemudakoding commented 1 year ago

Hi @Mutahhar glad to know you're using our package.

according the documentation, we introduce the real DDD which is use layers, so in our package we introduce 3 layer to play with DDD

so we can assume /app as application layer image

probably you gonna ask my why we put DTO in App layer why not put in domain directly? in my personal opinion domain shouldn't know how the data work, how the data get mapped, they just know how to consume the data, the data should be put in method argument from app layer (dependecy injection)

note: we can assume presentaion layer as app layer image

ref you can go thru. https://stackoverflow.com/questions/31438286/ddd-which-layer-dto-should-be-implemented https://docs.abp.io/pt-BR/abp/4.1/Domain-Driven-Design-Implementation-Guide#application-layer-building-blocks

if something you gotta ask don't hesitate to raise\ thanks.

pemudakoding commented 1 year ago

if you have any advice please let us know, so we can improve the package

pemudakoding commented 1 year ago

Sorry i got missunderstanding there has unknown bug, the diamond:install shouldn't generate app under src directory it should keep on laravel /app directory