davidbadura/fixtures
Flexible PHP fixtures library with YAML/JSON/TOML/PHP loaders, Faker support, automatic dependency resolution, configurable converters, tagging/filtering, validation via events, expression language, and persisters for Doctrine ORM/MongoDB and Propel.
fillable properties and validation rules.DatabaseTransactions or RefreshDatabase).Seeder lifecycle, Factory classes, or testing helpers (e.g., create(), factory()). Its strength lies in non-DB objects (e.g., API responses, cache entries) and complex fixture hierarchies.Seeder lifecycle or testing helpers. Potential conflicts with Laravel’s Factory or DatabaseSeeder remain unresolved.Factory for basic model seeding. Its value is highest for non-model objects or complex relationships.symfony/yaml).DatabaseTransactions support).Testing helpers, DatabaseTransactions, or RefreshDatabase.Schema migrations or Factory blueprints.Seeder/Factory?
Factory capabilities?DatabaseSeeder/ModelFactory code transition to this package?laravel-shift/database-faker, spatie/laravel-factories, pestphp/pest) that offer better maintenance?Factory suffices) or integration tests (where fixtures shine)?php artisan fixtures:load)?Factory is sufficient.DatabaseTransactions).seeds/ and factories/ to identify:
DatabaseSeeder with a custom FixtureSeeder for non-DB fixtures only (low risk).davidbadura/fixtures:^1.3.2 to composer.json.Seeder lifecycle:
// app/Console/Commands/LoadFixtures.php
use Davidbadura\Fixtures\Loader;
public function handle() {
$loader = new Loader();
$loader->load(base_path('fixtures'));
}
app/Console/Kernel.php.required, nullable).# fixtures/users.yml
users:
- id: 1
name: "John Doe"
email: "john@example.com"
age: null # Nullable field (now supported)
symfony/yaml (for YAML support) may need explicit version pinning (e.g., ^5.4).fakerphp/faker if both are used.Schema migrations).DatabaseSeeder entirely (high risk; test thoroughly with php artisan fixtures:load).phpunit.xml or GitHub Actions:
<env name="DB_FIXTURES" value="true"/>
php artisan fixtures:load && php artisan test
How can I help you explore Laravel packages today?