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
Client Identifier

Client Identifier Laravel Package

a4sex/client-identifier

Lightweight Laravel/PHP package for reliably identifying clients—devices, browsers, or API consumers—by generating and resolving stable client identifiers from request headers and fingerprints, with a simple API for middleware, Eloquent models, and service integration.

View on GitHub
Deep Wiki
Context7

At a glance

Frequently asked questions about Client Identifier
How do I install a4sex/client-identifier in a Laravel application?
The package is not distributed through Packagist, so a plain composer require will not find it. Add a repositories entry of type vcs pointing at https://gitlab.com/a4sex/php/library/client-identifier in composer.json, then require a4sex/client-identifier pinned to a specific tag or commit hash. Make sure your CI runners have read access to that GitLab group and commit the resulting lock file. Budget a short spike just to confirm resolution works against your illuminate/* constraints.
Does a4sex/client-identifier support Laravel 10 and Laravel 11?
The repository path suggests a framework-agnostic PHP library with at most a thin Laravel service provider, so version support depends on the illuminate/support constraints declared in its composer.json. Loose constraints usually resolve against Laravel 10 and 11 on PHP 8.2, but loose constraints also mean untested combinations. Check the actual constraint lines and run the test suite on your target versions before relying on it. If no Laravel bridge exists, you can still call the resolver directly from a middleware you write yourself.
What exactly does this client identifier resolve: IP address, user agent, or fingerprint?
That is not documented in the available metadata, and it matters for both stability and privacy: a raw IP, a hashed IP plus user agent, a cookie-backed ID, and a browser fingerprint have very different persistence and consent implications. Read the source, which should be small, and confirm which request attributes feed the identifier and whether a hash or fingerprint algorithm is used. Treat the answer as a design input rather than an implementation detail.
How do I use client identifiers in Laravel middleware for rate limiting?
Wrap the package behind your own ClientIdentifier contract, bind it in a service provider, and inject it into the middleware or the RateLimiter key closure. That keeps rate limiting, session binding, and audit logging call sites independent of the third-party API. If the package returns a simple string or DTO, the adapter is only a few lines. Ship it behind a feature flag until behavior with missing or spoofed headers has been verified.
Can I attach a client identifier to Eloquent models?
You can, but the package itself likely does not ship Eloquent traits or casts. Resolve the identifier in middleware or a request macro and store it as an indexed string column alongside a timestamp on whichever model needs it. Keep storage and retention policy in your own code so you can change identification strategy without a migration.
What happens when request headers are missing or spoofed?
That is unknown without reading the source, and the failure contract could be an exception, a null return, or a fallback value, each of which needs different handling. Test it directly in a sandbox with stripped and forged headers, or ask the maintainer to document the behavior. Assume spoofable inputs such as user agent, X-Forwarded-For, and custom headers can be attacker-controlled, and never treat the resulting identifier as authentication.
Is a4sex/client-identifier on Packagist, and how do I pin a version?
It has no visible Packagist listing, zero stars, and zero dependents, which also means there may be no semantic version tags. Use a VCS repository entry and pin to a commit hash or tag, then commit composer.lock so builds stay reproducible. Be aware that running composer update against a branch resolves to a moving target.
Does the package persist identifiers, and is it GDPR-safe?
It is unclear from the metadata, so confirm whether it writes cookies, cache entries, or database rows, and for how long. If identifiers are derived from IP addresses or device characteristics, treat them as personal data under GDPR and document lawful basis, retention, and hashing. Run a privacy review before enabling it on production traffic, especially for EU users.
What are the alternatives for client identification in Laravel?
A hashed IP plus user agent key, a signed cookie issued by your own middleware, or Laravel's built-in session and rate limiter keys cover most use cases. Building it in-house is roughly a day of work and removes an unvetted dependency from the request path. Consider using this package as a reference implementation while shipping your own fallback.
Is a4sex/client-identifier production-ready and actively maintained?
There is no adoption evidence: no stars, no dependents, an unfamiliar single-vendor namespace, and no signs of external review, so treat it as unproven. Before production, verify license compatibility, PHP and extension requirements, test suite and CI setup, commit recency, tag history, and who the accountable maintainer is. An unvetted third-party package in the request path is an unreviewed code-execution surface, so start with a sandbox spike and a feature flag.
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.
htinlynn/genius-helper
maco-studios/hephaestus
elmogy/larafast
xeviant/laravel-paystack
gorilladash/laravel-website-sdk
martialbe/flysystem-oss
chondal/3312client
jeroen-g/flickr
opscale-co/nova-genbi
itsjustvita/laravel-retention
tequilarapido/trackit
gregsphotography/site-builder-filament
cabaoctavio/laravel-query-log
gregsphotography/site-builder-components
io-digital/clickatell
snowsoft/laravel-admin
oxygen/auth
relicsoftware/barakah-payment-gateway
tobya/work-with-composer
equipc/laravel-email-validator