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 tourze/file-name-generator:^1.0. Treat 1.0.0 as the first semver-stable release and pin to ^1.0 in Laravel apps.src/, composer.json, and tests: identify the public generator class/interface, any Laravel service provider, config file, and extension/randomization behavior. If Laravel auto-discovery is not present, bind the generator interface in AppServiceProvider.Storage::disk(...)->putFileAs(...); keep the original filename in the database for display.App\Services\FileNameService. Controllers and jobs should call your wrapper, not package classes directly, so you can swap/decorate the generator later.putFileAs / storeAs when you need the exact generated filename. putFile / store may let Laravel choose names and bypass your generator.Storage::disk($disk)->exists($candidate) and retry.Storage::fake() and assert stored path plus database metadata. Include malicious names such as ../, null bytes, Windows reserved names, and double extensions.^1.0.php artisan config:cache after changes in deployed environments, otherwise config edits may not take effect.Storage::fake() assertions before blaming the generator.How can I help you explore Laravel packages today?