Domain Driver Design, directory help

Posted 1 month ago by luddinus

Hi.

I'm trying to follow this pattern, based a little bit on this project: https://github.com/spatie/attended.io/tree/master/app

This is my directory structure (more or less)

app
---...
---Domain
------User
---------Actions
------------UpdatePasswordAction.php
---------Models
------------User.php
------------Guest.php
---Http
------Controllers
---------Api
------------UsersController.php
-------------...
------Resources?
---------...

I want to make an api using Laravel Resources.

By default Laravel saves the Resources (via artisan) in the Http/Resources directory. Is it "more correct", in this case (UserListResource), to save in Domain/User/Resources directory? Or resources "belong" to Http?

At this time I think it fits better in Http/Resources directory because it's and "entry" point to the app.

Suggestions welcome!

Please sign in or create an account to participate in this conversation.

Reply to

Use Markdown with GitHub-flavored code blocks.