tourze/file-name-generator
A PHP package from Tourze for generating file names, helping create consistent, safe names for uploaded or stored files. Useful for avoiding collisions and keeping naming rules in one place.
composer require): Filename generation looks trivial until it isn't — Unicode normalization, path traversal (../), Windows reserved names (CON, PRN), collisions under concurrent uploads, and storage-backend key constraints all become defect tickets. Adopting a small, focused package removes that maintenance from your backlog for the cost of one dependency.spatie/laravel-medialibrary, intervention/image, or Flysystem. Positioning it as a naming utility rather than a storage layer keeps scope honest and prevents an architecture decision being made on the back of a ~1-file package.Adopt when most of the following hold:
Look elsewhere — or vendor the logic — when:
spatie/laravel-medialibrary + intervention/image territory; this package is not a substitute and layering it on top of one adds a dependency without adding capability.Caveat to raise explicitly: the 1.0.0 release notes are a changelog link with no described features, fixes, or breaking changes. That is not disqualifying, but it means the assessment above is driven by the version number and repository inspection, not by release content. Verify the 0.0.1→1.0.0 diff before committing, and confirm whether 1.0.0 introduced any breaking rename from the 0.x API — 0.x consumers upgrading should assume breakage until the diff says otherwise.
To executives: A small, low-cost dependency that eliminates a recurring class of bugs in file uploads — malformed names, overwrites, and storage failures caused by characters we did not anticipate. The 1.0.0 release gives us a stable API to pin against, which converts this from an experiment into a supportable choice. Cost is one pinned line in composer.json; the alternative is owning and testing that logic indefinitely. Risk is contained: it is a naming utility, not infrastructure, so it can be removed without an architecture change.
To engineering: Add it behind our existing upload service, not sprinkled at call sites, so the dependency stays swappable. Pin to ^1.0 and review the changelog on minor bumps. Before merge, confirm the repo has a license, a test suite, and a real diff between 0.0.1 and 1.0.0 — the release notes do not describe one, so treat the tag as a claim to verify rather than a guarantee. Do not extend it into media handling; keep it single-purpose and keep the surrounding concerns (validation, storage, image processing) where they already live.
How can I help you explore Laravel packages today?