campo/random-user-agent
Campo Random User Agent is a Laravel/PHP package that generates realistic random user-agent strings on demand. Rotate browser identities in scrapers, tests, or request simulations using simple helpers and configurable lists of desktop and mobile agents.
User-Agent headers without hand-maintaining strings. High-frequency, low-blast-radius use. Release 1.3.0 (list loaded once per process rather than re-read per call) marginally improves this by removing repeated I/O from loops, factories, and seeders — it does not change what the data is.random_item helper (~30 minutes). Buy = one Composer line, zero transitive dependencies, and now a slightly better implementation of the wrapper.Adopt only when all of these hold:
1.3.0) or fork/vendor it. 1.3.0 is the first release since 2018-06-13 and is a small performance change, not evidence of a maintenance cadence — there is no security-response channel, no changelog discipline, and no known downstream dependents to absorb breakage. Treat the version pin as load-bearing, not hygiene.Look elsewhere (or build in-house) when:
Accept-Language + Client Hints + TLS/JA3 + viewport). That's a data pipeline, not a library.fakerphp/faker's userAgent provider is already in most Laravel stacks (zero new dependency), or an internally owned JSON list refreshed on a schedule.To executives: A small, MIT-licensed, single-purpose PHP utility that returns random User-Agent strings. Free, no transitive dependencies, no vendor lock-in, negligible integration cost. Version 1.3.0 landed with a minor performance improvement (the agent list is now loaded once instead of per call), which is the first upstream activity since 2018 and is a good sign but not a strategy change: the dataset is still a 2018 snapshot and there is no support commitment. Recommendation is unchanged: do not adopt it as a strategic dependency; if a team needs the capability, spend the hour to vendor the list into our own codebase so we own freshness and support. No budget, no procurement, no roadmap impact.
To engineering: One class over a static array — no I/O beyond the initial load, no side effects, no configuration surface. 1.3.0 memoizes the list load, so it is now appropriate for tight loops (load generators, large factories); there are no API or signature changes to migrate around. Integration remains a composer require plus a one-line call, e.g. Http::withHeaders(['User-Agent' => $ua]) in a test or a seeder factory. The real risk is decay, not attack surface: PHP 8 compatibility is still unverified and the UA snapshot is roughly seven years stale, and a single housekeeping release does not change that trajectory. If adopted, pin 1.3.0 exactly, wrap it behind a single internal interface so we can swap in Faker's provider or our own list without touching call sites, and record the decision to fork if we ever need current browser data — noting that forking now also means forking around this caching fix.
How can I help you explore Laravel packages today?