Skip to content

v0.7.0

Compare
Choose a tag to compare
@JasperTey JasperTey released this 23 Oct 01:41
· 85 commits to main since this release
0a3d435

[0.7.0] - 2023-10-22

Added

  • Formal support for subdomains (nested domains). For example, to generate model Domain\Reporting\Internal\Models\InvoiceReport, the domain argument can be specified with dot notation: ddd:model Reporting.Internal InvoiceReport. Specifying Reporting/Internal or Reporting\\Internal will also be accepted and normalized to dot notation internally.
  • Implement abstract Lunarstorm\LaravelDDD\Factories\DomainFactory extension of Illuminate\Database\Eloquent\Factories\Factory:
    • Implements DomainFactory::resolveFactoryName() to resolve the corresponding factory for a domain model.
    • Will resolve the correct factory if the model belongs to a subdomain; Domain\Reporting\Internal\Models\InvoiceReport will correctly resolve to Database\Factories\Reporting\Internal\InvoiceReportFactory.

Changed

  • Default base model implementation in base-model.php.stub now uses DomainFactory::factoryForModel() inside the newFactory method to resolve the model factory.

BREAKING

  • For existing installations of the package to support sub-domain model factories, the base model's newFactory() should be updated where applicable; see base-model.php.stub.
use Lunarstorm\LaravelDDD\Factories\DomainFactory;

// ...

protected static function newFactory()
{
    return DomainFactory::factoryForModel(get_called_class());
}

What's Changed

  • feat: Add support for subdomains in newFactory method by @meditto in #29
  • Bump actions/checkout from 3 to 4 by @dependabot in #32
  • Bump stefanzweifel/git-auto-commit-action from 4 to 5 by @dependabot in #33
  • feat: Add support for subdomains in newFactory method (#29) by @JasperTey in #31

New Contributors

Full Changelog: v0.6.1...v0.7.0