nolanos/laravel-doctrine-factory
Pros:
has(), for()), sequences, and lifecycle hooks (afterMaking, afterCreating), addressing gaps in the official laravel-doctrine/orm factory system.Cons:
laravel-doctrine/orm (≥v2.0) and Laravel ≥8.x (explicitly tested on 11.x).HasFactory trait (similar to Eloquent).create(), new(), state(), sequence()).laravel-doctrine/orm factories may suffice with minimal refactoring.HasFactory trait on Eloquent models with the Doctrine-compatible version.use Stemble\DoctrineFactory\HasFactory;
#[ORM\Entity]
class User
{
use HasFactory;
// ...
}
// Before (Eloquent)
User::factory()->state(['role' => 'admin'])->create();
// After (Doctrine)
UserFactory::new()->state(['role' => 'admin'])->create();
has()/for() helpers to reference Doctrine entities.// Before
User::factory()->hasPosts(3)->create();
// After
UserFactory::new()->has(PostFactory::new(), 3)->create();
laravel-doctrine/orm ≥v2.0 (check for breaking changes in Doctrine 3.x).phpunit/phpunit and fakerphp/faker are compatible with the package’s version constraints.dama/doctrine-test-bundle).TestUser, ReportData).Order, Product) after validating Phase 1.factory:refresh, factory:publish).composer.json until stability is confirmed.FACTORY_RULES.md for the team.factory:serve to inspect generated data.recycle() for large datasets).parallel() testing feature may not interact well with Doctrine’s connection pooling.How can I help you explore Laravel packages today?