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

Doctrine Support

This documentation is for the package darsyn/ip-doctrine, which was split into a separate package in v5+ so that PHP version requirements could be updated independently. Require that as a Composer dependency to use this functionality.

This library can be used to support IP address as column types with Doctrine DBAL versions ^2.3 || ^3.0.

Three Doctrine types are provided to match the three version classes:

  • Darsyn\IP\Doctrine\IPV4Type supports the IPv4 class.
  • Darsyn\IP\Doctrine\IPV6Type supports the IPv6 class.
  • Darsyn\IP\Doctrine\MultiType supports the Multi class.
<?php
use Darsyn\IP\Doctrine\MultiType;
use Doctrine\DBAL\Types\Type;

Type::addType('ip', MultiType::class);

If you are using Symfony, then add the following to your main configuration:

doctrine:
    dbal:
        types:
            ip: Darsyn\IP\Doctrine\MultiType

Now you can happily store IP addresses in your entities like nobody's business:

<?php
use Darsyn\IP\Version\Multi as IP;
use Doctrine\ORM\Mapping as ORM;

#[ORM\Entity]
class AnalyticsEntity
{
     #[ORM\Column(type: 'ip')]
    public IP $ipAddress;
}
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.
andydefer/laravel-notification
adachsoft/cli-process-tester
jhaskell13/laraflow
sebastienheyd/boilerplate-media-manager
ccast/tagixo-primix
pretendtrue/laravel-builder
sawmainek/laravel-scout-tntsearch-driver
tomshaw/laravel-calendar-table
dibakar/laravel-ownership
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