directorytree/dummy
directorytree/dummy is a Laravel/PHP package providing a lightweight dummy/test utility for generating placeholder data and fixtures. Useful for local development, demos, and automated tests where realistic sample content is needed quickly and consistently.
directorytree/dummy package is a test data factory for Laravel, designed to simplify the creation of fake data for testing and development. It aligns well with Laravel applications requiring mock data generation, seeders, or test doubles without tight coupling to Laravel’s core.Arr helpers, improved testing utilities).Arr helper (v1.3.1+) for consistency with modern Laravel conventions.HasFactory trait (v1.3.0+), enabling stateful factories—useful for complex test scenarios (e.g., user roles, payment states).orchestra/testbench in dev dependencies, suggesting built-in Laravel testing support (e.g., for HttpTests, FeatureTests).HasFactory and Arr helpers assume familiarity with Laravel’s factory pattern and collection helpers.orchestra/testbench for Laravel integration tests, adding CI/CD complexity if not already in use.fakerphp/faker or laravel/model-factory) justifies adoption.Factory::new()) or generic PHP fake data?fakerphp/faker (more generic, no Laravel ties).laravel/model-factory (Laravel-native, but heavier).mockery/mockery (for mock objects).Factory or Fake?HasFactory?Factory for complex state management.HasFactory and Arr helpers may require shims.Arr::get() with array_key_first() for vanilla PHP.testbench for Laravel-specific features.HasFactory.fakerphp/faker or Laravel’s Factory for performance.UserFactory with Dummy::factory(User::class)->state([...]).composer.json:
"require-dev": {
"directorytree/dummy": "^1.3",
"orchestra/testbench": "^9.0" // if using Laravel tests
}
phpunit.xml or pest.php to recognize HasFactory.HasFactory for dynamic states.data_get() calls with Arr::get() (v1.3.1+).testbench and pest are compatible with your CI (e.g., GitHub Actions, CircleCI).| Component | Compatibility Notes |
|---|---|
| Laravel 11/12 | ✅ Full support (v1.2.0+) |
| Laravel <11 | ⚠️ May need helper shims (e.g., Arr alternatives) |
| Non-Laravel PHP | ⚠️ Possible with adapters for HasFactory and Arr |
| PestPHP | ✅ Native support (dev dependency) |
| PHPUnit | ✅ Works, but testbench adds Laravel-specific features |
| Symfony | ❌ No native support; requires custom integration |
composer.json and test basic factory usage.HasFactory for dynamic states.data_* helpers with Arr::* (v1.3.1+).Dummy for mock data.HasFactory and Arr helpers require Laravel knowledge for maintenance.HasFactory pattern.Arr helper usage.| Risk | Impact | Mitigation Strategy |
|---|---|---|
| Package abandonment | Stalled updates, security risks | Fork or switch to fakerphp/faker if needed |
| Laravel incompatibility | Breaks on new Laravel versions | Pin to specific versions in composer.json |
| Dynamic state bugs | Flaky tests | Isolate stateful factories in test suites |
| Non-Laravel integration issues | Limited functionality | Use as a data |
How can I help you explore Laravel packages today?