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

UploadFile

Zend\Validator\File\UploadFile checks whether a single file has been uploaded via a form POST and will return descriptive messages for any upload errors.

Basic Usage

use Zend\Http\PhpEnvironment\Request;
use Zend\Validator\File\UploadFile;

$request = new Request();
$files   = $request->getFiles();
// i.e. $files['my-upload']['error'] == 0

$validator = new UploadFile();
if ($validator->isValid($files['my-upload'])) {
    // file is valid
}

PSR-7 Support

  • Since 2.11.0

Starting in 2.11.0, you can also pass PSR-7 UploadedFileInterface instances as values to the validator. When valid, getValue() will return the instance validated verbatim:

$validator = new UploadFile();

// [@var](https://github.com/var) Psr\Http\Message\UploadedFileInterface $uploadedFile
if ($validator->isValid($uploadedFile)) {
    // file is valid
    $validInstance = $validator->getValue(); // === $uploadedFile
}

Usage with zend-inputfilter

When using zend-inputfilter's FileInput, this validator will be automatically prepended to the validator chain.

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