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 Field Type Bundle Laravel Package

evotodi/ip-field-type-bundle

View on GitHub
Deep Wiki
Context7

Symfony PhpStorm

Ip Field Type Symfony Bundle

Provide an ip field for symfony forms.

Requirements

  • Symfony >= 5.4
  • PHP >= 7.4

Installation

Composer

composer require evotodi/ip-field-type-bundle

Usage

Create your form:

$form = $this->createFormBuilder()
	->add('ip', IpType::class) // Defaults to ipV4
	->add('send', 'submit')->getForm();

Examples:

	->add('ip', IpType::class, array('version' => 'ipv4', 'readonly' => true, 'clear' => false));
	->add('ip', IpType::class, array('version' => 'ipv6', 'disabled' => true))
	->add('ip', IpType::class, array('version' => 'mac', 'required' => false))

Options:

Type Option Values (defaults are bold) Description
string version ipv4, ipv6, mac Sets the layout and type of input
bool disabled true, false Disables the input
bool readonly true, false Makes the input readonly
bool required true, false Makes the input required
bool clear true, false Display a clear input link

View:

{{ form_start(form) }}
    {{ form_errors(form) }}
		{{ form_widget(form.ip, { 'id': 'my_ip_field', 'class': 'form-control' }) }}
		{{ form_widget(form.mac, { 'id': 'my_mac_field' }) }}
		{{ form_widget(form.gw, { 'id': 'my_gw_field' }) }}
		{{ form_widget(form.netmask) }}
	{{ form_rest(form) }}
{{ form_end(form) }}

Value validity:

The submitted values are not validated. You need to validate them.
Javascript tries to ensure that the values typed are valid but this is not guaranteed.

Licence

This bundle is under the MIT Licence.

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.
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
artisan-build/community-prompts
vleroy/smart
ayles-software/laravel-australian-public-holidays
cboxdk/laravel-id-spatie
cboxdk/laravel-id-billing
cboxdk/laravel-id-billing-bridge
simple-as-fuck/php-performance-log
hsluv/hsluv
seampact/codegen