hamaelt / zip-mime-type-validator
There is no license information available for the latest version (1.0.1) of this package.
Laravel zip file mime type validator
1.0.1
2021-07-03 18:30 UTC
Requires
- php: ^7.4|^8.0
- ext-zip: *
- illuminate/contracts: ^6.0|^7.0|^8.0
- illuminate/support: ^6.0|^7.0|^8.0
Requires (Dev)
- orchestra/testbench: ^4.0|^5.0|^6.0
- phpunit/phpunit: ^8.0|^9.0
This package is not auto-updated.
Last update: 2025-04-20 15:32:01 UTC
README
A validation rule for validating MIME type of zip files for Laravel to validate that the zip file only contains the allowed file types.
Installation
$ composer require hamaelt/zip-mime-type-validator
Requirement
- PHP 7.4 or higher
Usage
In your custom request class use ZipMimeType
rule with passing the required file types as a string.
use Hamaelt\ZipValidator\Rules\ZipMimeType;; public function rules() { return [ 'zip_file' => [ 'required',new ZipMimeType('pdf,jpg,png')], ]; }