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

darsyn/ip

Laravel package for working with IP addresses: parse and validate IPv4/IPv6, compare and normalize formats, check ranges and subnet/CIDR matches, and convert between representations. Useful for request filtering, geo/security rules, and logging.

View on GitHub
Deep Wiki
Context7

Formatters

Internally, this library uses the PHP functions inet_pton and inet_ntop. However the inet_ntop function formats some IP addresses in an inconsistent and non-standard way (for example, the IP address ::ffff:c22:384e would be returned as ::ffff:12.34.56.78 when converting its binary representation to human-readable protocol via inet_ntop).

This library provides a pure-PHP implementation called Darsyn\IP\Formatter\ConsistentFormatter to return IP addresses in the correct format, which is used by default.

However should you wish to use the native implementation for any reason, you may set the Darsyn\IP\Formatter\NativeFormatter globally:

<?php
use Darsyn\IP\Formatter\NativeFormatter;
use Darsyn\IP\Version\Multi as IP;

IP::setProtocolFormatter(new NativeFormatter);
$ip = IP::factory('::ffff:c22:384e');
$ip->getCompactedAddress(); // string("::ffff:12.34.56.78")
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.
steadrun/laravel-monitor
labyrinthe/connect-laravel
elmogy/layan
drewdan/sentinel-client
dskripchenko/laravel-llm
fatryst/nuonuo
stevenay/myanfont
gmostafa/php-graphql-client
xeviant/paystack
snowsoft/faker
meditationsteps/blogetc
animalyoung/laravel-influxdb
onix-solutions/sms-telera
lonely-lights/prosetta
oxygen/data
oxygen/core
jengo/base
xiloryx/log-collector
a21ns1g4ts/filament-stripe
la-php/laravel-admin