Weave Code
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

Zend Validator Laravel Package

zendframework/zend-validator

Powerful validation library from Zend Framework for PHP apps. Provides a wide range of reusable validators, input filtering, and custom rule support with clear error messages. Integrates easily into forms and domain validation workflows.

View on GitHub
Deep Wiki
Context7

Explode Validator

Zend\Validator\Explode executes a validator for each item exploded from an array.

Supported options

The following options are supported for Zend\Validator\Explode:

  • valueDelimiter: Defines the delimiter used to explode values from an array. It defaults to ,. If the given value is an array, this option isn't used.
  • validator: Sets the validator that will be executed on each exploded item. This may be a validator instance, or a validator service name.

Basic usage

To validate if every item in an array is in a specified haystack:

$inArrayValidator = new Zend\Validator\InArray([
    'haystack' => [1, 2, 3, 4, 5, 6],
]);

$explodeValidator = new Zend\Validator\Explode([
    'validator' => $inArrayValidator
]);

$explodeValidator->isValid([1, 4, 6]);    // returns true
$explodeValidator->isValid([1, 4, 6, 8]); // returns false

Exploding strings

To validate if every e-mail in a string is contained in a list of names:

$inEmailListValidator = new Zend\Validator\InArray([
    'haystack' => ['joseph@test.com', 'mark@test.com', 'lucia@test.com'],
]);

$explodeValidator = new Zend\Validator\Explode([
    'validator' => $inEmailListValidator,
    'valueDelimiter' => ','
]);

$explodeValidator->isValid('joseph@test.com,mark@test.com'); // returns true
$explodeValidator->isValid('lucia@test.com,maria@test.com');  // returns false
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.
davejamesmiller/laravel-breadcrumbs
artisanry/parsedown
christhompsontldr/phpsdk
enqueue/dsn
bunny/bunny
enqueue/test
enqueue/null
enqueue/amqp-tools
milesj/emojibase
bower-asset/punycode
bower-asset/inputmask
bower-asset/jquery
bower-asset/yii2-pjax
laravel/nova
spatie/laravel-mailcoach
spatie/laravel-superseeder
laravel/liferaft
nst/json-test-suite
danielmiessler/sec-lists
jackalope/jackalope-transport