manageitwa/laravel-fixtures
Laravel Fixtures provides a simple way to define, load, and manage fixture data for your Laravel applications and tests. Seed databases with structured, reusable datasets, keep test data organized, and swap fixtures between environments with a clean, expressive API.
manageitwa/laravel-fixtures is a fixture-loading package for Laravel that lets you define reusable data sets and load them into the database (typically in tests or seeders). As of v1.4.0 it supports Laravel 11 and 12, so it drops cleanly into modern apps.
Where to look first:
composer.json / package README — confirm the PSR-4 namespace and the config key. Fixture packages almost always ship a config/fixtures.php you can publish.php artisan vendor:publish --tag=fixtures-config
tests/Fixtures, database/fixtures, or a path set in config. Match the package default before pointing it elsewhere.First use case — seed a single representative record set in a feature test:
use ManageItWA\Fixtures\Facades\Fixtures; // verify exact namespace in README
public function test_orders_index(): void
{
Fixtures::load('orders');
$this->get('/orders')->assertOk();
}
If the package uses PHP fixture files, define your first fixture in the conventional path and inspect the returned records/count to confirm it loaded. Start with one fixture, verify it against a RefreshDatabase test, then expand.
Test isolation. Pair fixtures with RefreshDatabase (or DatabaseTransactions) so each test starts from a clean slate. Fixtures loaded once at class setup will leak between tests otherwise.
Fixture-per-scenario. Structure fixture files by intent (orders_empty, orders_with_refunds, users_admin) rather than by table. Loading a scenario is easier to reason about than composing table-level dumps.
Seeding in production/local. If the package supports it, reuse fixtures for local dev seeding through a seeder that calls the loader, so test data and dev data stay in sync. Guard this so it never runs against production.
Composition over mega-fixtures. Prefer loading several small fixtures in a setup method rather than one giant file. Keep relationships explicit (parents before children) unless the package handles dependency ordering.
CI integration. Add fixture loading to your test bootstrap or a base TestCase::setUp() so developers don't wire it per-test. On Laravel 11/12 (slim skeleton), confirm the tests/TestCase.php still boots the app correctly.
Version-aware install. In composer.json, require ^1.4 and let it resolve against Laravel 11 or 12. If you support both 10 and 11/12, verify the older line still installs — v1.4.0 signals current support, not necessarily a hard break with 10.
config/, confirm the service provider still registers and the config is merged (fallback) correctly rather than only read from a published file.tests/ may not be autoloaded or may be excluded by phpunit.xml <source>/<coverage> settings. Check .gitattributes export-ignore and composer autoload if fixtures "disappear" in CI.RefreshDatabase's transaction wrapping. Pick one strategy; mixing them produces confusing "data already exists" errors.php artisan config:clear after changing fixture paths. In CI, a stale bootstrap/cache/config.php is a common reason fixtures look in the wrong directory.^1.4 in production rather than a floating constraint, and smoke-test the upgrade against your existing fixtures before rolling out.How can I help you explore Laravel packages today?