Download the PHP package net-code/laravel-domain without Composer

On this page you can find all versions of the php package net-code/laravel-domain. 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-domain

net-code/laravel-domain

DDD tactical building blocks — the reusable kernel that concrete bounded contexts build on. The core (NetCode\Domain\*) is pure PHP 8.5+ (only ramsey/uuid); a thin, optional Laravel integration layer (NetCode\Domain\Laravel\*) wires the kernel into a Laravel app through an auto-discovered service provider.

Install

What's inside

Class / interface Purpose
NetCode\Domain\AggregateRoot Base aggregate that records and releases domain events.
NetCode\Domain\ValueObject Base value object with an equals() contract.
NetCode\Domain\DomainEvent Marker interface for events (occurredOn()).
NetCode\Domain\DomainEventPublisher Publisher seam implemented by the host application.
NetCode\Domain\Identifier\Uuid Base for typed UUID identifiers (UUIDv7).
NetCode\Domain\Rule\BusinessRule A single invariant that can be broken.
NetCode\Domain\Rule\BusinessRuleCode Backed-enum contract for machine-readable rule codes.
NetCode\Domain\Rule\TranslatableRuleParams Optional translation parameters for a rule.
NetCode\Domain\Rule\Specification Checks rules and throws BusinessRuleException on the first broken one.
NetCode\Domain\Rule\BusinessRuleException Carries the broken rule's code and translation params.
NetCode\Domain\Exception\DomainException Base for domain-layer exceptions.
NetCode\Domain\Exception\InvalidArgumentException Invalid value-object input.

Laravel integration (NetCode\Domain\Laravel)

Class Purpose
DomainServiceProvider Auto-discovered; binds DomainEventPublisher → LaravelDomainEventPublisher.
LaravelDomainEventPublisher Publishes domain events through Laravel's event dispatcher.
IdentifierCast Eloquent cast between a string column and a typed Identifier\Uuid.

Usage

Typed identifier

Aggregate + domain events

Business rules via a specification

Specification::check() is a static, stateless guard — call it directly from your aggregates. There is no instance to construct, inject, or subclass.

Laravel integration

DomainServiceProvider is auto-discovered, so DomainEventPublisher resolves to LaravelDomainEventPublisher (domain events go through Laravel's dispatcher) with zero wiring. Cast a model's identifier column to its typed value object:

Development

License

MIT


All versions of laravel-domain with dependencies

PHP Build Version
Package Version
Requires php Version ^8.5
illuminate/contracts Version ^13.0
illuminate/database Version ^13.0
illuminate/support Version ^13.0
ramsey/uuid Version ^4.9
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 net-code/laravel-domain contains the following files

Loading the files please wait ...