Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Faker Php Laravel Package

xefi/faker-php

xefi/faker-php is a PHP library for generating realistic fake data for tests, fixtures, demos, and database seeding. It provides a simple API for names, addresses, emails, dates, text, and more, with locale-aware data generation.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Test-data strategy (build vs. buy vs. keep): this package is a viable third option to "keep FakerPHP forever" or "build our own generators." It supports a decision on whether to standardize fixtures/seeding on a framework-agnostic core with framework bridges, rather than an implicit dependency bundled with the framework.
  • Localization roadmap and rollout sequencing: locales are separately installable packages. That supports a market-by-market launch plan — ship only the regions we actually operate in, no vendored datasets for 40 languages we don't serve, and add a locale as a dependency bump rather than a code change.
  • Reproducibility as a quality goal: randomness routes through an injected Random\Randomizer, so a seeded run reproduces. This underpins decisions about CI flake budgets, golden-fixture/snapshot testing, and reliable bug reproduction from a failing build.
  • Deterministic, isolated test environments: each call constructs a fresh container, so modifiers and strategies don't leak between calls. That supports parallel test execution and ordering-independent suites — a real cost driver as suites grow.
  • Internal "shared test data" as a product: domain generators (order numbers, SKUs, regulatory IDs, tenant shapes) can live in our own packages and be auto-discovered via extra.faker.providers in composer.json. This supports a genuine build decision — one owned fixture package across services instead of copy-pasted helpers.
  • Developer productivity / agent-assisted development: the generated faker_mixin.php gives IDE and coding-agent autocompletion over whatever generators are installed. That supports tooling and onboarding investments, and makes custom generators discoverable without reading source.
  • Non-production data posture: seeding dev/staging databases with synthetic data instead of masked production copies supports privacy and compliance commitments in lower environments.

When to Consider This Package

Adopt-worthy criteria:

  • Greenfield services or a monorepo already on PHP 8.3+ (it will not run below that — a hard gate, not a preference).
  • You want a small, modular dependency footprint and are willing to install locales and extras à la carte rather than take one bundled mega-package.
  • Determinism matters to you: seeded, reproducible fixtures, stable snapshots, reproducible CI failures.
  • You span more than one framework (Laravel today, Symfony or plain PHP elsewhere) and want one fixture layer, with bridges maintained separately.
  • You have domain-specific fake data needs and want them as first-class, composable extensions rather than one-off helpers.
  • Apache-2.0 is acceptable to legal (it is), and you're comfortable with a small-vendor dependency for a dev-only package.

Look elsewhere when:

  • You have a large existing investment in FakerPHP providers and Laravel model factories. Migration cost is real, and the incumbent's ecosystem breadth (providers, formatters, community answers) is its main asset.
  • Ecosystem maturity and support are procurement requirements. At roughly 188 stars and zero dependents, this is early-adoption territory: bus factor, long-term maintenance, and "who do we call" are legitimate concerns. Treat it as a dev-only dependency you can swap, not a platform bet.
  • You need broad localized data from a single install with no extra packages.
  • You require SLAs, security review paperwork, or a vendor with a support contract.

Before committing, run a one-sprint bake-off. Specific behaviors to validate, because they are documented hazards rather than hypotheticals:

  • The extension registry and bootstrappers are static and process-global; tests must call forgetExtensions() and forgetBootstrappers() or providers register twice and emit warnings. Confirm this fits your test bootstrap.
  • unique() draws from a process-global pool that is never reset and throws MaximumTriesReached once a bounded set (enum, fixed list, small integer range) is exhausted. Any team reaching for unique() on a bounded set will get a flaky-then-broken suite. Confirm a lint rule or convention can prevent it.
  • Generation is capped at 20,000 tries before throwing — fine for normal strategies, worth knowing for tight constraints.
  • Method names are globally unique across all installed extensions, including third-party ones; collisions produce an E_USER_WARNING with last-registration-wins. Audit your planned extension set for name clashes before you depend on the behavior.

How to Pitch It (Stakeholders)

For executives: This is a small, Apache-2.0 fake-data generator for PHP tests and database seeding — no license cost, no vendor lock-in. It's worth a pilot because it addresses two costs we already carry: flaky, non-reproducible test data, and an all-or-nothing dependency that bundles locales and features we don't use. Because it's modular, we ship only the locale data for the markets we operate in, and because it's deterministic under a seed, failures reproduce instead of being re-run until green. The honest caveat is maturity: it's a young package with a small community, so the recommendation is a contained pilot in one service, wrapped in our own fixture package so we can revert to the incumbent at low cost. Decision requested: approve a one-sprint evaluation, not a migration.

For engineering: The architecture is deliberately clean and is the main argument for it. A thin Faker entry point builds a fresh container per call, so modifiers and strategies never leak between calls; extensions are plain classes where every public method becomes a Faker method; providers register via a manifest read from extra.faker.providers across installed packages, cached and auto-recompiled. Randomness is injected, not rand()-based, so seeds are honored. A generated docblock mixin gives IDE and agent autocompletion for installed generators. It's framework-agnostic by design — framework code lives in separate bridge packages — and CI runs the suite on PHP 8.3, 8.4 and 8.5 against lowest and highest dependencies. Tests are PHPUnit 12.

For risk reviewers: Dev-only dependency; blast radius is limited to test and seeding tooling. Three documented sharp edges to mitigate up front: the process-global static extension registry, the never-reset unique() pool, and global method-name collisions across extensions. All three are containable with our own fixture wrapper package and a short internal usage note — and that wrapper is also our exit ramp.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
pharaonic/laravel-notification-dependencies
beautinow/translug
dev-brainiac/bot-cloaked
octoberrain/html
octoberrain/extension
octoberrain/exception
octoberrain/contracts
frankyso/ipaymu
3mdikram/worldmoneywords
snowsoft/config
itmosoft/laravel-subscriptions
larva/laravel-ai-qwen
adachsoft/api-version-bundle
cgv/localized-resource
noith/settings
kda/laravel-package
kda/filament-dynamic-navigation
bypersoft/signbox
pairus/product-data
fayne/laravel-filament-cms-core