{"id":23507311,"url":"https://github.com/othercodes/laravel-domain-driven","last_synced_at":"2026-03-16T11:08:52.606Z","repository":{"id":268884746,"uuid":"898415912","full_name":"othercodes/laravel-domain-driven","owner":"othercodes","description":"Laravel domain-driven development starter template. ","archived":false,"fork":false,"pushed_at":"2025-05-06T01:59:17.000Z","size":516,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-10T15:49:10.222Z","etag":null,"topics":["boilerplate","ddd","laravel"],"latest_commit_sha":null,"homepage":"","language":"Vue","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/othercodes.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-12-04T10:59:34.000Z","updated_at":"2025-04-30T05:01:17.000Z","dependencies_parsed_at":"2024-12-19T14:23:19.370Z","dependency_job_id":"fa8a7b9c-1c44-4abe-a0e3-747a1a85696b","html_url":"https://github.com/othercodes/laravel-domain-driven","commit_stats":null,"previous_names":["othercodes/laravel-domain-driven"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/othercodes/laravel-domain-driven","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/othercodes%2Flaravel-domain-driven","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/othercodes%2Flaravel-domain-driven/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/othercodes%2Flaravel-domain-driven/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/othercodes%2Flaravel-domain-driven/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/othercodes","download_url":"https://codeload.github.com/othercodes/laravel-domain-driven/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/othercodes%2Flaravel-domain-driven/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266602758,"owners_count":23954694,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-22T02:00:09.085Z","response_time":66,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["boilerplate","ddd","laravel"],"created_at":"2024-12-25T10:17:44.910Z","updated_at":"2026-03-16T11:08:52.554Z","avatar_url":"https://github.com/othercodes.png","language":"Vue","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Laravel Domain Driven\n\n\u003ca href=\"https://laravel.com/docs/11.x\"\u003e\u003cimg src=\"https://img.shields.io/badge/Laravel-11-FF2D20.svg?style=flat\u0026logo=laravel\" alt=\"Laravel 11\"/\u003e\u003c/a\u003e\n\u003ca href=\"https://www.php.net/releases/8.2/en.php\"\u003e\u003cimg src=\"https://img.shields.io/badge/PHP-8.2-777BB4.svg?style=flat\u0026logo=php\" alt=\"PHP 8.2\"/\u003e\u003c/a\u003e\n\u003ca href=\"https://github.com/othercodes/laravel-domain-driven/actions/workflows/test.yml\"\u003e\u003cimg src=\"https://github.com/othercodes/laravel-domain-driven/actions/workflows/test.yml/badge.svg\" alt=\"Test\"/\u003e\u003c/a\u003e\n\nWelcome to Laravel Domain Driven! This is a Laravel starter designed to help you build applications using Hexagonal\nArchitecture and Domain-Driven Design (DDD).\n\nWith this starter, your project is organized into clear layers, keeping your core business logic separate from other\nparts of your application. This makes your code easier to maintain and adapt over time. By using DDD, you can model your\nbusiness problems more clearly and build software that is easy to change as your needs evolve.\n\nWhether you're starting a new project or improving an existing one, Laravel Domain Driven gives you a strong foundation\nfor building flexible, high-quality applications.\n\n## 🤔 Why use Laravel Domain Driven?\n\n**Laravel Domain Driven** brings together the power of **Laravel**, **Domain-Driven Design (DDD)**, and **Hexagonal\nArchitecture**, offering key benefits:\n\n- **Clear and Organized Code**: DDD and Hexagonal Architecture help keep your business logic separate from other parts\n  of the app, making your code easier to understand and manage.\n\n- **Easy to Scale and Update**: This structure allows your application to grow and change over time without needing\n  major rewrites.\n\n- **Well-Structured Application**: By combining Laravel’s features with DDD, your project becomes more organized, making\n  it easier to work with.\n\n- **Easier to Test and Maintain**: Hexagonal Architecture focuses on clean design, making it simpler to test and\n  maintain your code.\n\n- **The Power of Laravel**: Laravel provides a modern and elegant framework with built-in tools for routing,\n  authentication, database management, and more, helping you develop quickly and efficiently while maintaining\n  high-quality code.\n\nUsing **Laravel Domain Driven** helps you build clean, flexible, and long-lasting applications.\n\n## ✨ Features\n\n**Laravel Domain Driven** includes the core features provided by **Laravel Jetstream**, but organized using \n**Domain-Driven Design (DDD)** and **Hexagonal Architecture**. Key features include:\n\n- **Authentication**: User registration, login, password reset, email verification, and more, powered by **Laravel\n  Fortify**.\n- **Authorization**: Role-based access control with user roles and permissions.\n- **Two-Factor Authentication (2FA)**: Extra layer of security for user accounts, integrated with **Laravel Fortify**.\n- **Session Management**: Manage active sessions and log users out of other devices.\n- **Profile Management**: Users can update their profile information, including email and password.\n- **Inertia.js with Vue 3**: Provides a modern, single-page app experience with a clean structure for building\n  interactive UIs, while still leveraging the full power of Laravel on the backend.\n- **Tailwind CSS**: Utility-first CSS framework that makes it easy to create responsive and customized designs without\n  writing custom CSS.\n- **Laravel Sanctum**: Simple token-based API authentication system, allowing you to securely authenticate and manage\n  user sessions for SPAs and mobile applications.\n- **Laravel Sail**: Lightweight Docker environment for developing Laravel applications locally, simplifying setup and\n  development.\n- **Laravel Pint**: A zero-config PSR-12 compliant PHP code style fixer, ensuring consistent coding standards across\n  your project.\n- **Larastan**: Static analysis tool that helps detect potential issues in your code, improving code quality and\n  reducing bugs.\n- **Pest**: A modern testing framework for PHP that makes testing simpler, faster, and more readable, providing a fluent\n  and expressive syntax for writing tests.\n\nThese features are structured in a way that keeps your business logic clean, maintainable, and aligned with modern\ndevelopment practices.\n\n## ⚙️ Installation\n\nTo get started with Laravel Domain Driven, you just need to execute the following command:\n\n```bash\ncomposer create-project usantisteban/laravel-domain-driven:dev-master my-app\n```\n\n## 📁 Structure\n\nThe structure of the `app/` directory in **Laravel Domain Driven** starter package is organized around different\ncontexts, each representing a specific area of functionality in the application. This setup follows Domain-Driven\nDesign (DDD) principles and Hexagonal Architecture, providing a clear separation of concerns.\n\n**Bounded Contexts**: Each context represents a specific part of the business domain and is loaded using a dedicated\nservice provider. For example:\n\n* 🛡️ **Identity And Access**: Contains everything related to authentication and authorization.\n* 🔄 **Shared**: Holds common functionality used across the entire application, such as utilities, helpers, and common\n  services.\n\n```\napp\n├── IdentityAndAccess\n│   └── IdentityAndAccessServiceProvider.php\n└── Shared\n    └── SharedServiceProvider.php\n```\n\nEach context is divided into **modules**, with each module representing an aggregate root. An aggregate root is a group\nof related information and behaviors that work together as a single unit. For example:\n\n* 👤 **User**: Contains all information and logic related to users, such as authentication, profile, and roles.\n* 🛒 **Order**: Manages the order details, status, and so on.\n* 💳 **Invoice**: Represents the invoicing process, including item details, totals, and payment status.\n\n```\napp\n└── IdentityAndAccess\n    ├── IdentityAndAccessServiceProvider.php\n    └── Users\n```\n\nEach module follows a 3-layer architecture:\n\n```\napp\n└── IdentityAndAccess\n    ├── IdentityAndAccessServiceProvider.php\n    └── Users\n        ├── Application\n        ├── Domain\n        └── Infrastructure\n```\n\n🏠 **Domain**\n\nThe **Domain** layer contains the core business logic of the application. It includes the entities, value objects, and\ndomain services that define the rules for the root aggregate. In the **IdentityAndAccess** context, specifically for the\n**User** aggregate, the **Domain** layer includes:\n\n```\napp\n└── IdentityAndAccess\n    ├── IdentityAndAccessServiceProvider.php\n    └── Users\n        └── Domain\n            ├── Agent.php\n            ├── Contracts\n            │   └── UserRepository.php\n            ├── Events\n            │   ├── UserCreated.php\n            │   ├── UserDeleted.php\n            │   ├── UserEmailUpdated.php\n            │   └── UserNameUpdated.php\n            ├── Exceptions\n            │   ├── UserException.php\n            │   └── UserNotFound.php\n            ├── PasswordValidationRules.php\n            └── User.php\n\n```\n\n📋 **Application**\n\nThis layer contains use cases, commands, and application services, defining how the business logic is used to\nfulfill the application's requirements.\n\n```\napp\n└── IdentityAndAccess\n    ├── IdentityAndAccessServiceProvider.php\n    └── Users\n        └── Application\n            ├── CreateUser.php\n            ├── DeleteUser.php\n            ├── EventHandlers\n            │   └── SendUserEmailVerification.php\n            ├── FindUser.php\n            ├── ResetUserPassword.php\n            ├── UpdateUserPassword.php\n            └── UpdateUserProfileInformation.php\n```\n\n🌐 **Infrastructure**\n\nThe layer responsible for interacting with external systems, such as databases, APIs, and file systems. It includes\nrepositories, external services, and infrastructure-specific configurations.\n\n```\napp\n└── IdentityAndAccess\n    ├── IdentityAndAccessServiceProvider.php\n    └── Users\n        └── Infrastructure\n            ├── Http\n            │   └── Controllers\n            │       ├── Concerns\n            │       │   ├── ConfirmsPasswords.php\n            │       │   └── ConfirmsTwoFactorAuthentication.php\n            │       ├── DeleteUserController.php\n            │       ├── OtherBrowserSessionsController.php\n            │       ├── UserProfileController.php\n            │       └── UserProfilePhotoController.php\n            └── Persistence\n                ├── EloquentUserRepository.php\n                └── UserFactory.php\n```\n\nThis structure ensures that each part of the application is clearly defined, maintainable, and focused on its specific\ndomain, while following DDD and Hexagonal Architecture principles.\n\n## ⚠️ Disclaimer\n\nThis repository represents my personal approach to implementing Domain-Driven Design (DDD) and Hexagonal Architecture\nusing the Laravel framework. While I believe this structure can provide a solid foundation for many projects, it may not\nfit every use case or project type.\n\nPlease note that this starter is still in early stages, and there is a lot of room for improvement. Contributions,\nfeedback, and suggestions are welcome as I continue to refine and expand this project.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fothercodes%2Flaravel-domain-driven","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fothercodes%2Flaravel-domain-driven","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fothercodes%2Flaravel-domain-driven/lists"}