hamaelt / zip-mime-type-validator
Laravel zip file mime type validator
Installs: 7
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/hamaelt/zip-mime-type-validator
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-10-19 17:44:08 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')], ]; }