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

Dummy Laravel Package

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.

View on GitHub
Deep Wiki
Context7

Getting Started

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:

  1. PHP version — v2.0.0 requires PHP 8.3–8.5. If your app or CI image is on 8.2, this is the one thing that will block you.
  2. GD extension — required for image generation. php -m | grep -i gd locally, and make sure your Dockerfile has docker-php-ext-install gd.
  3. Published assets — without the dummy-assets tag publish, image examples will 404 in Blade.
  4. The hosted demo — https://kerns.github.io/dummy/ is the fastest way to discover syntax (including the image options, which the README covers better than the release notes do).

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.

Implementation Patterns

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.

Gotchas and Tips

  • It's a --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().
  • PHP 8.3 is a hard floor now. This is the only genuinely breaking change for existing users. Bump composer.json ("php": "^8.3") and your CI matrix together, or Composer will resolve you back to v1 on 8.2 runners.
  • Session and memory-limit side effects were removed. If anything in your app quietly depended on the package starting a session or raising memory_limit, set those explicitly in config/session.php / your bootstrap. This is a silent behavioural change, not an error.
  • Determinism. Per-request caching speeds things up but means output is stable within a request and different across requests. Never assert on exact strings in tests — assert on word counts or assertNotEmpty().
  • Image cache needs a writable path. Renders are cropped/resized in a single GD pass and written atomically, which is good (no half-written files), but the target directory still needs to be writable by the web user. Failures here usually surface as broken images rather than exceptions — check storage/ permissions first when images go missing.
  • Debugging text output. If counts look wrong, confirm you used : not = and that the range is min-max with no spaces. Ranges are inclusive, so 2-3 yields two or three paragraphs, never one.
  • Extension points are deliberately thin. There's no documented custom-text-pool or driver registration in this release; if you need domain-specific filler, wrap the package in your own helper rather than reaching into internals that may not exist.
  • Verify before trusting. v2.0.0's claim of 58 tests across six PHP × Laravel combinations is a good sign, but it isn't your app's matrix. Smoke-test one factory and one image render on your actual runtime before rolling it across a large test suite.
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.
elsayed85/laravel-api-exceptions
ouhssini/laravel-demo-mode
daworks/ncloud-outbound-mailer-driver
gp247/cms
ignibyte/aic-gates
nexa-merchant/blog
novasa/laravel-language-center
opencage/geocode
adolfoholzer/parameters
livenetworks/ln-starter
shitoudev/permissionmanager
johannesclimacus/laravel-tui
hocvt/seotools
vitalybaev/sypexgeo
amphibee/themosis-ignition
gito-me/fast-excel
frankyso/laravel-ipaymu
geolize-studio/laravel-chile
boomerangui/chat
cgv/localized-resource