项目作者: atsuyokota

项目描述 :
RESTful API and DDD sample with Laravel
高级语言: PHP
项目地址: git://github.com/atsuyokota/laravel-ddd-api.git
创建时间: 2020-01-28T04:24:06Z
项目社区:https://github.com/atsuyokota/laravel-ddd-api

开源协议:

下载


RESTful API and DDD sample with Laravel

環境構築

  • Copy .env file from .env.example, and modify DB_HOST and DB_PASSWORD according to your envirnoment.
  • Follow the steps below.
    1. composer install
    2. php artisan migrate
    3. php artisan db:seed

アーキテクチャー

  • ドメイン層にレポジトリのインターフェイスを設置し、インフラストラクチャー層から依存するように実装しています。

ディレクトリ構成

  1. src/
  2. └── Demo
  3. ├── Application
  4. └── UseCase
  5. └── UserUseCase.php
  6. ├── Domain
  7. ├── Exception
  8. └── InvalidDomainException.php
  9. ├── Model
  10. ├── DateOfBirth.php
  11. ├── Email.php
  12. ├── Gender.php
  13. ├── Name.php
  14. └── User.php
  15. └── Repository
  16. └── UserRepositoryInterface.php
  17. ├── Infrastructure
  18. ├── Eloquent
  19. └── UserEloquent.php
  20. ├── InfrastructureProvider.php
  21. ├── Repository
  22. └── UserRepository.php
  23. └── Translator
  24. └── UserTranslator.php
  25. └── Presentation
  26. ├── Controllers
  27. ├── ApiController.php
  28. └── UserController.php
  29. └── Resources
  30. └── UserResource.php