xsolve-pl/model-factory
xsolve-pl/model-factory is a Laravel package for quickly generating model factories, helping you scaffold test data and simplify Eloquent model setup. It streamlines factory creation so you can focus on writing tests and building features.
spatie/laravel-data, Fractal, or a small in-house transformer. The type-based factory registry and lazy nested-model creation are the differentiators worth evaluating.Consider it when:
toArray() methods.Look elsewhere when:
spatie/laravel-data, Laravel API Resources, or Symfony Serializer.To executives: This is a small, MIT-licensed library that cleanly separates domain objects from API output using a factory pattern — a well-understood idea. However, with 2 stars, zero dependents, and no release since 2021, it carries meaningful maintenance and longevity risk. Recommend it only as a timeboxed evaluation to validate the pattern, not as a platform bet. There is no license cost; the real cost is ownership.
To engineering: The design is sound — type-declared factories, groupable collections, lazy nested models — and it solves a real problem (keeping serialization out of domain code). The trade-off is that you would be adopting an orphaned dependency: expect to vendor/fork it, verify compatibility with your PHP/Laravel versions, and own bug fixes. Run a short spike comparing it head-to-head with spatie/laravel-data and native API Resources; if the pattern wins but the package doesn't, replicate the ~200-line core in-house. Default recommendation: validate the pattern, then build or buy a supported alternative.
How can I help you explore Laravel packages today?