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

Ip Laravel Package

josantonius/ip

A lightweight PHP library for retrieving the client IP address, with helpers to validate IPs, detect private or reserved ranges, and handle proxied requests. Framework-agnostic and easy to drop into Laravel or any PHP project.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Feature enablement for anything location- or identity-adjacent. IP resolution is a hidden prerequisite for geo-based pricing/currency, localized content, tax/VAT estimation, language defaults, regional feature flags, and timezone inference. If any of these are on the roadmap, request-IP correctness becomes a shared foundation rather than a per-feature detail.
  • Abuse, rate limiting, and fraud controls. Per-IP throttling, disposable-proxy detection, signup/login anomaly scoring, and bot mitigation all depend on reliably resolving the real client IP behind CDNs, load balancers, and reverse proxies. This is a security-adjacent decision, not a cosmetic one.
  • Analytics and auditability. Session attribution, funnel analysis, consent/terms acceptance logging, and security audit trails typically persist IP alongside timestamps. Data-model and retention decisions here have compliance consequences (IP is personal data under GDPR/CCPA).
  • Build vs. buy vs. vendor. This package is ~a few dozen lines of header inspection. The genuine product decision is not "adopt this library" but "do we own a small, auditable request-context helper, or do we take a dependency for it?" For a 2022-archived, 11-star, zero-dependent package, the defensible answer is almost always: own it.
  • Roadmap sequencing. If IP resolution is needed by more than one near-term initiative (e.g., localization and rate limiting and audit logging), sequence a single internal RequestContext/ClientIpResolver capability early, with tests for spoofed headers, IPv6, and trusted-proxy configuration — rather than letting three teams each paste a different snippet.
  • Vendor-risk posture. The high "opportunity" score against an archived, unmaintained, near-zero-adoption package is itself the signal: the gap is a missing internal utility, not a package to adopt.

When to Consider This Package

Consider it only under narrow conditions:

  • You need a throwaway or internal-only script (CLI-adjacent tooling, a one-off migration, an internal admin page behind a trusted network) where IP is informational and never used for security or authorization decisions.
  • You are on legacy PHP without a framework and want a minimal drop-in rather than writing header parsing yourself — and you intend to vendor or fork the code into your repo (it's MIT) so you are not depending on an archived upstream.
  • You need a reference implementation of the header precedence order (X-Forwarded-For, X-Real-IP, CF-Connecting-IP, etc.) to review before writing your own — treat it as documentation, not a dependency.
  • Your team accepts no upstream fixes, has verified PHP-version compatibility in your runtime, and has an owner assigned to the vendored copy.

Look elsewhere — or build — when:

  • You are on Laravel or Symfony. $request->ip() with properly configured TrustProxies/trusted_proxies, or Request::getClientIp(), already solves this with framework-maintained security fixes. Adding a package here is net-negative.
  • IP feeds security, rate limiting, geo-compliance, or fraud decisions. Raw X-Forwarded-For is client-spoofable; you need an explicit trusted-proxy allowlist and header precedence you control and can test.
  • You need IPv6 edge cases, CIDR matching, geo lookup, or ASN data — out of scope for this package.
  • Your supply-chain policy blocks archived/unmaintained dependencies, or your security review requires an active maintainer and CVE response path.
  • You need observability or normalization (masking/truncation for privacy, consistent representation across services).

How to Pitch It (Stakeholders)

To executives: The relevant question is not whether to adopt this specific library — it's a tiny, archived, low-adoption utility — but whether we have one trustworthy way to know where a request came from. That single capability quietly underpins localization, pricing, fraud controls, and audit logging, and it carries privacy obligations. My recommendation: do not add this as a dependency. Fund a small internal component (roughly a day of engineering plus tests) that we own, review, and can extend. Cost is negligible; the value is avoiding divergent, untested IP logic across teams and avoiding a stale third-party dependency in a security-adjacent path.

To engineering: This package is ~a few dozen lines reading $_SERVER headers, last released mid-2022, archived, zero dependents. On Laravel, use $request->ip() with a correct TrustProxies configuration; on Symfony, Request::getClientIp() with trusted proxies. Where we're outside a framework, vendor the header-precedence logic into our own helper with tests covering spoofed X-Forwarded-For, multi-hop proxy chains, IPv6, and missing headers. Either way, we treat client IP as untrusted input and never use it as an authorization signal.

To security/compliance: IP is personal data in several jurisdictions. Owning the resolver lets us enforce truncation/masking at capture, define retention, and document exactly which proxy headers we honor — all of which are hard to guarantee when the logic lives in an archived dependency we don't control.

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.
skyraptor/chatter
edlugz/sasapay
abbasudo/artisan-route
mirvan/ippanel
ignibyte/aic-framework
glavweb/data-schema-bundle
glavweb/datagrid-bundle
tacticmedia/scim-server
uni-method/frame
neika-ai/sdk
adachsoft/php-code-style
pharaonic/laravel-notification-dependencies
beautinow/translug
dev-brainiac/bot-cloaked
octoberrain/html
octoberrain/extension
octoberrain/exception
octoberrain/contracts
adachsoft/api-version-bundle
cgv/localized-resource