kerns/dummy
kerns/dummy is a Laravel package for quickly generating dummy data and placeholder records. It helps you seed models and populate applications with realistic sample content for testing, demos, and local development, reducing boilerplate and speeding up your workflow.
kerns/dummy is a dev-only generator for lorem ipsum copy and placeholder images. Install it as a dev dependency and let Laravel 12/13 package discovery register the provider:
composer require --dev kerns/dummy
php artisan vendor:publish --tag=dummy-assets
First things to check before writing any code:
php -m | grep -i gd locally, and make sure your Dockerfile has docker-php-ext-install gd.dummy-assets tag publish, image examples will 404 in Blade.First use case: fill a seeder or factory with realistic-length copy instead of fake()->text():
// database/factories/PostFactory.php
'title' => dummy('text@words:5-9,title'),
'excerpt' => dummy('text@sentences:2'),
'body' => dummy('text@paragraphs:3-5'),
Then move on to images once you've confirmed GD is loaded.
Exact vs. ranged counts. Every text@ generator accepts a single number or a range, and this is the main reason to prefer it over Faker for layout work: you can guarantee a card never overflows.
dummy('text@words:30-60'); // range
dummy('text@sentences:3'); // exact
dummy('text@paragraphs:2-3'); // paragraph blocks for article bodies
Title casing for headings. The ,title modifier is positional — it comes after the range:
dummy('text@words:5-9,title'); // Headline-Style Output
Use it for <h1>/nav/card titles and leave it off body copy. Don't try to Str::title() the output yourself; the modifier exists so headings and body share one generator call.
Seeding and demos. Because the package caches text pools and directory scans per request, generating a whole seed batch in one command is cheap. This is the intended pattern: one seeder, hundreds of rows, no per-call filesystem thrash.
public function run(): void
{
Post::factory()->count(200)->create();
}
Blade fixtures and UI states. Use the package in layouts you're prototyping before real content exists — long-word edge cases, short excerpts, multi-paragraph bodies. Pair it with the image generators (see the demo for the density/preview syntax) to stub avatars, hero images, and thumbnails in one pass.
Non-Laravel contexts. v2.0.0 also supports standalone Composer and folder-only installs, so the same syntax works in a static marketing prototype or a design handoff without booting Laravel. That's useful for keeping fixture copy identical between the app and a design repo.
Upgrade path. The dummy(), dumb_luck(), and dumb_question() signatures are unchanged from v1, so this is mostly a drop-in — the work is validating your PHP version and GD, not rewriting call sites.
--dev package. Guard your call sites. Nothing stops dummy() from rendering in production, and it will happily serve lorem ipsum to real users. Keep it in factories/seeders/tests, or gate demo routes behind app()->isLocal().composer.json ("php": "^8.3") and your CI matrix together, or Composer will resolve you back to v1 on 8.2 runners.memory_limit, set those explicitly in config/session.php / your bootstrap. This is a silent behavioural change, not an error.assertNotEmpty().storage/ permissions first when images go missing.: not = and that the range is min-max with no spaces. Ranges are inclusive, so 2-3 yields two or three paragraphs, never one.How can I help you explore Laravel packages today?