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

This package is not auto-updated.

Last update: 2024-09-22 12:42:43 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')],
    ];
}