v0.7.0
[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
. SpecifyingReporting/Internal
orReporting\\Internal
will also be accepted and normalized to dot notation internally. - Implement abstract
Lunarstorm\LaravelDDD\Factories\DomainFactory
extension ofIlluminate\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 toDatabase\Factories\Reporting\Internal\InvoiceReportFactory
.
- Implements
Changed
- Default base model implementation in
base-model.php.stub
now usesDomainFactory::factoryForModel()
inside thenewFactory
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; seebase-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