Skip to content

Domain Driven Design and Hexagonal Architecture example API using Laravel

Notifications You must be signed in to change notification settings

fSchettino/ddd-hexagonal-architecture-laravel

Folders and files

NameName
Last commit message
Last commit date

Latest commit

06ae76b · Aug 22, 2020

History

6 Commits
Aug 22, 2020
Aug 21, 2020
Aug 21, 2020
Aug 21, 2020
Aug 21, 2020
Aug 21, 2020
Aug 21, 2020
Aug 22, 2020
Aug 21, 2020
Aug 21, 2020
Aug 21, 2020
Aug 21, 2020
Aug 21, 2020
Aug 21, 2020
Aug 21, 2020
Aug 21, 2020
Aug 21, 2020
Aug 21, 2020
Aug 21, 2020
Aug 21, 2020
Aug 21, 2020
Aug 21, 2020
Aug 21, 2020

Repository files navigation

DDD & Hexagonal Architecture with Laravel

Implementing Domain Driven Design and Hexagonal Architecture example API using Laravel.

Installing:

  1. Clone repository: git clone https://github.com/fSchettino/ddd-hexagonal-architecture-laravel.git.
  2. Move to project folder: cd ddd-hexagonal-architecture-laravel.
  3. Duplicate .env.example file and set your variables.
  4. Install project dependencies: composer install.
  5. Generate encryption key: php artisan key:generate.
  6. Create a new schema in your database.
  7. Execute migration: php artisan migrate.
  8. Start server: php artisan serve.

Tests:

Run: php artisan test.

API endpoints:

Create a new user:
POST - http://127.0.0.1:8000/api/user
Body object:
{
  "name": "Firstname Lastname",
  "email": "[email protected]",
  "password": "password_example"
}

-------------------------------------------

Get created user:
GET - http://127.0.0.1:8000/api/user/1

-------------------------------------------

Update existing user:
PUT - http://127.0.0.1:8000/api/user/1
Body object:
{
  "name": "Name Surname",
  "email": "[email protected]"
}

-------------------------------------------

Delete user:
DELETE - http://127.0.0.1:8000/api/user/1

About

Domain Driven Design and Hexagonal Architecture example API using Laravel

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published