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

Html Faker Laravel Package

awcodes/html-faker

A Laravel package that adds HTML-aware fake data generators to Faker, letting you seed tests and demos with realistic markup—headings, paragraphs, lists, links, and more—instead of hand-written placeholder HTML.

View on GitHub
Deep Wiki
Context7

awcodes/html-faker is a lightweight PHP package that generates realistic, randomized HTML markup using Faker, making it easy to populate tests, demos, and prototypes with believable markup instead of hand-written placeholders. It integrates cleanly into Laravel applications and test suites, so you can produce varied, structured elements on demand without repetitive boilerplate.

  • Generates random HTML tags, attributes, and nested structures
  • Returns Faker-compatible output ready for seeders and factories
  • Ideal for testing, demo content, and rapid prototyping
  • Simple, fluent API with minimal setup
  • Works within Laravel and standalone PHP projects
Frequently asked questions about Html Faker
What does awcodes/html-faker actually do?
It is a lightweight PHP package that adds HTML-aware fake data generators to FakerPHP, producing randomized headings, paragraphs, lists, links, and nested markup instead of hand-written placeholder HTML. It plugs into the Faker generator that Laravel already ships, so you call it the same way you call fake(). It does not parse, validate, sanitize, or reason about DOM structure, so treat the output as plausible markup only.
How do I install awcodes/html-faker in a Laravel app?
Install it as a dev dependency with composer require --dev awcodes/html-faker:^0.4. Laravel package auto-discovery registers the Faker provider, so there is no config file, service layer, or manual wiring in a standard application. After that, generate one sample on a branch and dump the raw string to confirm you get structured markup rather than escaped or truncated text.
Which Laravel and PHP versions does awcodes/html-faker support?
The v0.4.0 release note states support for Laravel 12 was added, but that is a single line on an archived pre-1.0 repository. There is no Laravel 13 path and no PHP 8.5 path planned. Run composer why-not awcodes/html-faker ^0.4 against your actual lockfile before assuming it resolves in your app.
Is awcodes/html-faker still maintained?
No. The repository was archived as of the last release on 2025-06-10 (v0.4.0), with roughly 11 stars and zero dependents, so there is no security triage, no issue response, and no ecosystem support channel. Adoption is permanent ownership by default. The honest posture is to treat it as frozen, pinned, and covered by a documented fork contingency.
Can I use awcodes/html-faker in factories and seeders?
Yes, factory states, seeders, and test fixtures are exactly where it belongs, sitting beside fakerphp/faker as a dev-only utility. Because it is installed with --dev, confirm that no production or staging deploy path runs a seeder that references it, or that deploy will break. Keep all generation behind a single call site so the dependency is easy to remove later.
Does awcodes/html-faker generate safe or sanitized HTML?
No. It generates plausible markup, not adversarial markup, and it never sanitizes its own output. That makes it the wrong input for sanitizer test corpora, accessibility checking, or content integrity work, and it should never be treated as production demo content. If your roadmap assumes otherwise, correct that assumption before it reaches a plan.
Can I use awcodes/html-faker outside of Laravel?
Yes. It is a FakerPHP provider rather than a Laravel-specific component, so it works in standalone PHP projects where you register the provider on a Faker generator instance yourself. In Laravel, auto-discovery does that registration for you, which is why setup there is basically zero.
What are good alternatives to awcodes/html-faker?
You can write a handful of custom Faker formatters that wrap built-in text methods in tags, commit static HTML fixture files, or lift the package provider into your own tests/Support directory. Since the package is only a few hundred lines and plugs into an existing FakerPHP dependency, the lift is roughly one to two engineer-days when a future Laravel or PHP major breaks the pin. Any of these options removes the archived-dependency risk entirely.
How do I keep tests stable when using awcodes/html-faker?
Wrap generation behind a single seam, such as one helper or factory state, so a replacement is a one-file change rather than a test-suite rewrite. Keep it strictly in require-dev and avoid putting the archived package on an automated dependency-bump allowlist, since a silent transitive resolution change is a classic cause of phantom test failures. If output needs to be deterministic, control Faker seeding the same way you already do for other fake data.
How much effort is integrating awcodes/html-faker?
Low effort and low ambiguity: the realistic spike is about half a day to install, generate a sample on a branch, dump the raw string, and confirm you get structured markup instead of escaped text. Integration is essentially one factory state or seeder call site. The remaining decision is not technical, it is whether you accept ownership of a package that will never receive another commit.
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.
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console
pnscripts/filament-broadquill-lite
pnscripts/laravel-sentfold-lite
vleap/mx-sdk-laravel-internal
twidpay/utils
htetmyathlaing/scout-elasticsearch-driver
artisan-toolbox/front-awesome
ls/client-assistant
users-au/laravel-client
robertmarney/lara-hierarchial-collections
simonschaufi/rule-doc-generator
emissaoja/emissaoja
blackbricksoftware/gravityforms-civicrm-form-processor
al-rahabi/fancy-crud
jinas/dhivatar-component
mltstephane/laravel-quality
bernskiold/laravel-talentlms
bernskioldmedia/laravel-form-architect