Skip to content

Architecture

Domain Driven Design

When doing domain driven design, any entrypoint into the application should be contained in the App\ namespace.

For example, a UserController should go in App\Http\Controllers\, not App\Domains\User\Http\Controllers\. This is to make sure that controllers and commands stay separated from the domain-scope logic like repositories and services.

Should go inside domain:

  • Actions
  • Mail (to be discussed)
  • Models
  • Observers
  • Repositories
  • Resources
  • Services

Should not go inside domain:

  • Commands
  • Controllers
  • Factories
  • FormRequests
  • Jobs
  • Middleware