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

Laminas Validator Laravel Package

laminas/laminas-validator

Validation component for PHP and Laminas applications. Provides a wide range of ready-to-use validators (strings, numbers, dates, files, and more), consistent error messages, and an extensible API to create custom validators and input filtering rules.

View on GitHub
Deep Wiki
Context7

UploadFile

Laminas\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 Laminas\Http\PhpEnvironment\Request;
use Laminas\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

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 laminas-inputfilter

When using laminas-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.
hexters/coinpayment
rjcodes/rjcms
act-training/laravel-permissions-manager
alimarchal/laravel-chart-of-accounts
babenkoivan/elastic-scout-driver
mkwebdesign/filament-watchdog-v5
renatomarinho/laravel-page-speed
zedmagdy/filament-business-hours
renatovdemoura/blade-elements-ui
devgeek/beacon-admin
benjamin-rqt/data-watcher-bundle
atriumphp/atrium
sandermuller/package-boost-laravel
sandermuller/boost-skills
redaxo/core
yusufgenc/filament-api-forge
l3aro/rating-star-for-filament
leek/filament-subtenant-scope
anil/file-picker
broqit/fields-ai