toro/fixture-bundle
Toro Fixture Bundle provides a streamlined way to define, load, and manage fixtures in PHP applications, making it easy to seed databases and keep consistent test data across development and testing workflows.
composer.json first and check three things: "type" (almost certainly symfony-bundle), the autoload.psr-4 namespace (likely Toro\FixtureBundle\), and the require block (symfony/framework-bundle, doctrine/*). Those three lines tell you whether it is usable from Laravel at all.composer require --dev toro/fixture-bundle:^1.0
# if constraints fight your PHP version, point at the tag explicitly
composer require --dev toro/fixture-bundle:"dev-master#<2020-04-19-sha>"
src/*Bundle.php — the bundle class and whether it declares a container extension.src/DependencyInjection/Configuration.php and the matching *Extension.php — with no published docs, this file is the documentation. It is the only reliable list of config keys.tests/ — with no users and no docs, the tests are the specification.php artisan migrate --seed yields predictable app state, reusable in tests. The test is simple: do the fixture classes have a load()-style method and plain constructor dependencies? If yes, you can call them from a seeder within minutes. If they call $container->get(...) internally, stop and pick another tool.// database/seeders/ToroFixturesSeeder.php
class ToroFixturesSeeder extends Seeder
{
public function run(): void
{
// only if the fixture classes are container-free
(new \Toro\FixtureBundle\Fixture\SomeFixture())->load();
}
}
1. Symfony app — the intended path. Register in config/bundles.php, configure under the bundle's root key, run its console command. This is the only path the package was designed for; if you are in Laravel for the long haul, this pattern is not available to you.
2. Laravel — port the definitions, not the bundle. Copy the fixture classes into database/fixtures/ or tests/Fixtures/, add a PSR-4 mapping in composer.json, and replace Symfony container lookups with constructor injection resolved by Laravel's container. This is the highest-value path: you keep the domain-shaped fixture data and discard the wiring you cannot use.
3. Laravel — use it as a plain library. Instantiate fixtures manually with no kernel, no bundle registration, no extension config. Viable only if the classes avoid Symfony\Component\* and Doctrine\* imports entirely; grep the src/ tree for both before committing.
4. Test seeding. Pair RefreshDatabase with a trait that replays the same fixture set:
trait SeedsToroFixtures {
protected function seedFixtures(): void {
$this->artisan('db:seed', ['--class' => ToroFixturesSeeder::class]);
}
}
Seed any RNG (mt_srand, Faker's seed()) so failures are reproducible across runs.
5. Factories bridge. If the fixtures are essentially data arrays, feed them into Eloquent factories and let Laravel do persistence. You get relationship handling and states() for free, which the 2020-era bundle almost certainly does not have.
Integration tips
if (! app()->environment(['local', 'testing'])) { return; } — seeding is never a production operation.require-dev so it does not leak into production autoload; Laravel's package discovery is irrelevant here, so there is no dont-discover safety net.composer require will succeed and then do nothing: Laravel's discovery reads extra.laravel, and Symfony bundles ship extra.symfony. No service provider, no publishable config, no facade.doctrine/data-fixtures or an ObjectManager, installing doctrine/dbal is not enough — you need a second persistence layer alongside Eloquent. That mismatch alone usually kills adoption.ReturnTypeWillChange deprecations, hard-pinned symfony/* and doctrine/* constraints that will conflict with a modern app. Pin the tag and vendor it; do not expect upstream fixes. If you need to patch, fork to a private VCS repo.$container->get('toro_fixture.something') will fail in Laravel. grep -rn -- '->get(' src/ before you invest in porting.composer why toro/fixture-bundle, then composer dump-autoload -o, then php -r "var_dump(class_exists('Toro\\FixtureBundle\\ToroFixtureBundle'));". If that returns false, your namespace guess is wrong — go back to autoload.psr-4.symfony/framework-bundle into a Laravel vendor/. Install on a branch and read the composer.lock diff before merging.fakerphp/faker + model factories + seeders + RefreshDatabase covers the same ground with zero Symfony coupling and ongoing maintenance. Reach for this unless the bundle encodes non-trivial domain data you genuinely cannot re-express.How can I help you explore Laravel packages today?