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

Timezone Bundle Laravel Package

lunetics/timezone-bundle

Symfony bundle that detects a visitor's timezone from their IP address and exposes it through a simple service, with configurable fallbacks for timezone-aware applications.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture fit

  • Still not a Laravel package, but the "legacy Symfony 2 bundle" characterization needs correction: there are two distinct lines. The 3.0 line is Symfony 2.x-only (symfony/validator ~2.1). A 4.x line now exists and is the actively maintained one. Neither ships an Illuminate\Support\ServiceProvider, facade, publishable config, or Laravel-neutral view layer — integration is still via AppKernel registration, DependencyInjection/*Extension.php loaders, and compiler passes. The 4.0.1 note that the distribution gate requires the profiler template confirms continued coupling to Symfony's web-profiler/data-collector machinery, which has no Laravel analogue at all.
  • The reusable asset remains the detection strategy — the precedence order for inferring a visitor's timezone (request/session value, browser-supplied identifier, IP geolocation, server default) — not the packaged code.
  • The Laravel-equivalent surface is still one HTTP middleware plus a small container-bound service. That is a ~100–200 LOC port, not an integration.

Integration feasibility

  • Install-as-is: still not viable, now for a documented reason rather than an inferred one. The 4.0.1 notes state plainly that no released version of this bundle supports Symfony 6.4, and that 4.0.0's advice to point 6.4 applications at the 3.0 line produced an unsatisfiable resolution. Laravel 10 resolves symfony/* at 6.4; Laravel 11/12 at 7.x. So the package's own support matrix sits strictly below the floor of any currently supported Laravel. Composer will hard-conflict. Do not attempt.
  • Port-the-logic: viable and cheap, unchanged. MIT license permits reuse with attribution retained.
  • Adopt-adjacent: still preferred. jamesmills/laravel-timezone for per-user persistence, torann/geoip for IP lookup, or — best — capture Intl.DateTimeFormat().resolvedOptions().timeZone once client-side and persist it, eliminating the dependency question entirely.

Technical risk

  • EOL exposure is narrower than previously assessed, but not eliminated. The 3.0 line is genuinely unsupported (Symfony 2 ended 2018; validator ~2.1 implies PHP 5-era idioms). The 4.x line is a modernization, but its declared ceiling excludes 6.4, meaning the highest Symfony it supports is unverified and almost certainly ≤6.3. Any code lifted from 4.x must be re-checked against the project's Symfony/PHP target rather than assumed modern.
  • Maintenance signal upgraded. The 2026 release dates previously flagged as a metadata anomaly are now explained: there is an active 4.0.x cadence with release-gate work between 4.0.0 and 4.0.1. Treat the project as maintained-by-one, not abandoned. That is a real correction to the prior assessment.
  • Quality signal improved. Two specific hardening changes: the suite now fails on risky tests (previously a teardown that removed PHPUnit's own error handler could pass with a green exit code), and the distribution gate now requires the profiler template that only the weaker checkout-based gate covered. Both are the kind of fix that indicates the maintainer is tightening CI rather than just tagging. They also mean 4.0.1's "no runtime code changed" is credible — the diff is documentation, changelog dating, and gate configuration.
  • Documentation risk is the headline defect. 4.0.0 shipped install guidance that produced unsatisfiable Composer resolutions for 6.4 users. That is a correctness failure in the artifact most consumers read first, and it survived to a tagged release. Budget a verification step for any future upgrade advice from this source.
  • Unchanged risks: 26 stars / 0 dependents means no ecosystem validation and no production exercisers; IP geolocation implies either a bundled MaxMind GeoLite2 database (account, attribution terms, refresh cadence) or a remote API (latency, quota, cost, DPA); IP geolocation is systematically wrong for VPN, corporate egress, carrier NAT and CGNAT, and resolves to nothing in dev/container environments.

Key questions

  1. What is the actual product requirement — correct storage timezone, correct display timezone, or timezone-sensitive business rules (billing cutoffs, scheduling, notification windows)? This determines whether IP detection is needed at all.
  2. New: What Symfony versions does 4.x actually declare, and is there a planned 6.4/7.x line? If a 6.4-capable release lands, re-open the install-as-is question — though the Laravel-side integration gap would remain.
  3. New: Is the 4.0.0→4.0.1 changelog correction a one-off, or is documentation drift systemic? Sample the README's install instructions against a clean Composer resolve before trusting any guidance from this project.
  4. Is there any reason client-side detection (the Intl API, submitted once and persisted) is insufficient? This eliminates the entire dependency.
  5. Does the bundle ship a GeoIP database or call a remote service? What are the licensing and data-processing implications?
  6. What is the detection precedence when signals disagree, and is user override supported?
  7. Does the application already store timestamps in UTC everywhere? Detection is meaningless — and actively harmful — without UTC-normalized persistence.

Integration Approach

Stack fit

  • No first-party fit, and the 4.0.1 release does not change that: the maintainers themselves confirm no released version targets Symfony 6.4, which is the minimum for any supported Laravel. Classify this package as a reference implementation and design input, not a runtime dependency. The correct output of evaluating it is a documented detection precedence order and a middleware spec.

Migration path

  1. Spike (0.5 day): read the 4.x source — not the 3.0 line, which is Symfony 2-only — and document detection order, fallbacks, and configuration surface.
  2. Decide build vs. adopt: if the only requirement is per-user display timezone, adopt a maintained package or client-side capture and stop here.
  3. If IP detection is genuinely required: implement App\Services\TimezoneDetector with explicit ordered strategies (explicit user setting → session → IP lookup → app default), each behind a narrow interface so the geolocation provider is swappable.
  4. Wire a middleware: SetTimezone resolved per request on the web group, wrapped in try/catch with fail-open to the app default.
  5. Persist, don't re-resolve: write the resolved identifier to the user/profile record on first successful detection and short-circuit thereafter.
  6. Backfill: default existing users to the app default, then opportunistically upgrade on next authenticated request.

Compatibility

  • Do not add to composer.json. Pin nothing. The 4.0.1 notes confirm the compatibility ceiling sits below Laravel's Symfony floor, and that the previously published workaround (use 3.0 on 6.4) is unsound.
  • Ported code: verify it runs on the project's PHP target, strip Symfony DI/profiler coupling, and retain the MIT license header in the copied file.
  • Validate every resolved identifier against DateTimeZone::listIdentifiers() before persistence — do not trust provider strings, and never store raw UTC offsets.

Sequencing

Audit current timezone handling (storage, display, jobs) before introducing detection — most "wrong timezone" failures originate in UTC-non-normalized persistence. Then: detection service → middleware → per-user persistence → validation → observability. Ship detection last; it is the least load-bearing component.

Operational Impact

Maintenance

  • As a dependency: unmaintainable by construction. You inherit a support matrix that excludes the Symfony version your framework requires and permanently block Laravel/PHP upgrades for zero functional gain.
  • As ported code: fully owned, small, testable. Budget ~1–2 engineer-days including tests. The recurring burden is not code volume — it is the annual GeoIP database refresh and the provider contract.
  • Revised: the project is not dormant. Expect continued 4.0.x patches. That is mildly reassuring for the design reference but irrelevant to whether it can be installed here.

Support

  • No vendor, no community, no issue-response expectation; any defect requires source reading. The 4.0.1 correction demonstrates that published guidance from this project can be wrong in ways that block installs — treat its README as a claim to verify, not a source of truth.
  • Concentrate internal documentation on the detection precedence order. That is the non-obvious business logic and the most likely thing to be silently altered by a future contributor.

Scaling

  • In-process GeoIP lookup is microseconds-to-low-milliseconds and scales horizontally with the app; acceptable on the request path with a bounded cache.
  • Remote geolocation API per request is a hard no: 20–200ms added latency, per-request cost, and an external dependency in the critical path of every page load. Cache by IP with TTL, or better, resolve once per user.
  • Persisting the resolved timezone converts a per-request computation into a per-user one-time cost — this is the scaling decision that matters.

Failure modes

  • Geolocation timeout or quota exhaustion → fail open to the configured app default; never block or 500 a request.
  • Missing/corrupt GeoIP database → silent UTC fallback. Log at warning level so the degradation is visible.
  • Misdetection via VPN/CGNAT/carrier NAT → wrong local time shown. Mitigate with an explicit user-facing override; treat detection as a default, never as truth.
  • Offset arithmetic instead of identifiers → DST-transition bugs appearing twice a year, customer-visible in scheduled notifications, expensive to trace. Store IANA identifiers only.
  • Detected-but-not-persisted → nondeterministic timezone across requests and devices for the same user, producing timestamps that look like data corruption.
  • Trusting upstream compatibility claims → the concrete 4.0.0 failure mode: a documented install path that cannot resolve. Always validate version guidance against a real Composer run.

Ramp-up

  • Low technical ramp: small surface area, familiar HTTP-middleware pattern. The real learning curve is timezone semantics — storage in UTC, conversion at display and business-rule boundaries, and why offsets are not timezones.
  • Requires one engineer comfortable mapping Symfony DI concepts (extensions, compiler passes, tagged services) onto Laravel's container and middleware pipeline. That mapping is the only nontrivial part of the port.

Recommendation

Do not adopt lunetics/timezone-bundle as a dependency — a conclusion now supported by the maintainer's own compatibility statement rather than by inference. 4.0.1 is a documentation and release-gate release with no runtime change; it improves the project's credibility as a reference (tightened CI, risky tests now fail, changelog corrected) without moving it any closer to installable in a Laravel app. Re-read the 4.x source, document its detection precedence, and implement the equivalent as a single Laravel middleware plus a persisted per-user timezone — or eliminate the requirement entirely with one-time client-side detection.

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.
unabomber/timezone
delatbabel/contacts
astritzeqiri/g-recaptcha
kevinongko/laravel-genode
developeruz/laravel-analytics
robbiep/afterthedeadline
frankkessler/incontact-laravel-oauth2-rest
jlxh/laravel-userlog
davidmgilo/timetables
qylinfly/role-permission
reflect-digital/conduit
takashato/laravel-vietqr
aitor24/laralang
kraenzle-ritter/entity-relations
dindigital/din-image
pomirleanu/image-colors
sawmainek/laravel-api-generator
delatbabel/jsonresponses
mouhamedfd/permissions-generator
eduplus/qr