Download the PHP package ahmedsaed/laravel-ddd without Composer

On this page you can find all versions of the php package ahmedsaed/laravel-ddd. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-ddd

Laravel DDD

[!WARNING] Experimental Beta — v0.2.0-beta.3

Laravel DDD is still in beta. Commands, generated structures, and configuration may change before 1.0. Review CHANGELOG.md and UPGRADING.md before updating, and evaluate the package carefully before using it in production.

Laravel DDD provides an opinionated Context structure and Artisan generators for Laravel applications. Each bounded Context separates Domain, Application, Infrastructure, and Presentation code while continuing to use Laravel's container, routes, events, queues, mail, Eloquent, migrations, and testing tools.

The package creates directories and conservative class templates, discovers Context providers and Listeners, registers Context migration paths, and checks some dependency rules. It does not choose Context boundaries, design the business model, or prove that an application follows Domain-Driven Design.

This structure is most useful in applications with distinct business areas or teams that want explicit module boundaries. It is often unnecessary for a small CRUD application or short-lived prototype.

Requirements

Dependency Supported versions
PHP ^8.4
Laravel 11, 12, or 13

Installation

Install the beta, configure Context autoloading, and create the first Context:

Laravel normally discovers AhmedSaed\LaravelDdd\LaravelDddServiceProvider through Composer. If package discovery is disabled, add it to bootstrap/providers.php.

New installations use project-root contexts/ and the Contexts namespace. ddd:install adds that PSR-4 mapping to the application's root composer.json and runs composer dump-autoload. It is safe to run again and refuses to replace a conflicting mapping.

If the application needs a different Context root or namespace, publish and edit the configuration before running ddd:install:

This is the package's only publishing tag; generator stubs are not published. See Configuration for supported customizations.

Quick start

Generate a few components in the new Order Context:

Generated classes are deliberately small. Add the real invariants, fields, methods, mappings, and schema for the application.

The Context command creates OrderDatabaseSeeder. Add OrderSeeder::class to its $this->call(...) list when the child seeder should run with Context seeding. Then inspect the architecture and database plan:

The migration aliases use Laravel's registered migration paths; they are not Context-isolated operations. Read Context migrations and seeders before using rollback, reset, refresh, or fresh commands.

On a new Context, --with-aggregate can add only Domain/Aggregates/Order.php and Domain/Repositories/OrderRepository.php; no business methods are invented.

Generated Context structure

By default, php artisan ddd:make-context Order creates:

Config and Providers are uppercase; resources and tests are lowercase. The command also creates API and web route files plus Infrastructure/Persistence/Eloquent/Seeders/OrderDatabaseSeeder.php. It does not create sample business classes or frontend entry files. --with-vite creates only vite.config.js and uses the root application's Node dependencies.

Architecture

Dependencies point toward the business rules:

ddd:check enforces a documented subset of these rules by inspecting PHP namespaces and imports. Passing it does not prove that the architecture or business model is correct. See Architecture and the Architecture checker.

Domain Events and Listeners

Generate a Domain Event with ddd:make-event. If a Context needs to publish recorded events, opt in when creating it or add the publisher later:

The optional publisher consists of an Application contract, a Laravel Infrastructure adapter, and a provider binding. Laravel Listeners are created in Infrastructure/Listeners and discovered automatically for enabled Contexts:

--event accepts configured Context:EventName shorthand or a fully qualified PHP class name. The package does not provide an outbox, broker integration, retries, or external delivery guarantees. See Domain Events and integrations.

Migrations and seeders

Context migrations are normal Laravel migrations stored with the Context that owns the schema. Enabled Context providers register their migration paths, so native Laravel commands and ddd:migrate* aliases see the same complete path set unless an explicit Laravel --path is supplied.

Migration filenames must be globally unique across database/migrations and all registered Context migration paths. The package checks supported native and DDD migration command boundaries before Laravel begins migration work.

[!CAUTION] migrate:fresh and ddd:migrate-fresh wipe every table on the selected connection. Supplying a Context migration path does not make the wipe Context-only.

ddd:seed runs the conventional root seeder for one enabled Context or all enabled Contexts. It does not replace Laravel's application-level db:seed behavior.

Structural cache

ddd:cache stores Context provider and Listener discovery in the configured manifest. It does not cache provider method bodies, bindings, Domain Event classes, or business logic.

Successful ddd:make-context, ddd:make-provider, ddd:make-event-publisher, and ddd:make-listener runs clear the DDD manifest. ddd:make-event and manual binding edits do not. Failed generation leaves an existing manifest untouched.

Development falls back to live discovery after invalidation. In production, rebuild the DDD manifest explicitly:

If the deployment uses Laravel's event cache, rebuild it with php artisan event:cache after ddd:cache. Use php artisan ddd:clear to remove only the DDD manifest.

Documentation


All versions of laravel-ddd with dependencies

PHP Build Version
Package Version
Requires php Version ^8.4
illuminate/console Version ^11.0 || ^12.0 || ^13.0
illuminate/contracts Version ^11.0 || ^12.0 || ^13.0
illuminate/database Version ^11.0 || ^12.0 || ^13.0
illuminate/filesystem Version ^11.0 || ^12.0 || ^13.0
spatie/laravel-package-tools Version ^1.16
symfony/process Version ^7.0.3 || ^8.0.5
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package ahmedsaed/laravel-ddd contains the following files

Loading the files please wait ...