laminas/laminas-validator
Laminas Validator provides flexible, reusable validation rules for PHP applications. Includes built-in validators, input filtering/validation chains, and tools for validating common data types like emails, URLs, numbers, strings, and more.
Laminas\Validator\File\IsImage checks if a file is an image, such as jpg or png.
This validator is based on the MimeType validator and supports
the same methods and options.
The default list of image file MIME types can be found in the source code.
Please refer to the MimeType validator for options and public methods.
$validator = new Laminas\Validator\File\IsImage();
if ($validator->isValid('./myfile.jpg')) {
// file is valid
}
How can I help you explore Laravel packages today?