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

FilesSize

Laminas\Validator\File\FilesSize allows validating the total size of all file uploads in aggregate, allowing specifying a minimum upload size and/or a maximum upload size.

Only use this validator if you will be expecting multiple file uploads in a single payload, and want to ensure the aggregate size falls within a specific range.

Supported Options

Laminas\Validator\File\FilesSize supports the following options:

  • min: The minimum aggregate size of all file uploads. May be specified as an integer or using SI units. null indicates no minimum size is required.
  • max: The maximum aggregate size of all file uploads. May be specified as an integer or using SI units. null indicates no maximum size is required.
  • useByteString: A flag indicating whether sizes should be reported as integers or using SI units when reporting validation errors.

See the Size validator for details on supported SI units.

Basic Usage

use Laminas\Validator\File\FilesSize;

$validator = new FilesSize([
    'min' => '1kB',  // minimum of 1kB
    'max' => '10MB', // maximum of 10MB
]);

if ($validator->isValid($_FILES)) {
    // > 1kB, < 10MB in aggregate
}

Accepted Uploaded File Types

This validator accepts and validates 3 types of argument:

  • A list of strings that represents paths to existing files
  • An array that represents uploaded files as per PHP's $_FILES superglobal
  • A list of PSR-7 UploadedFileInterface instances
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