hamaelt / zip-mime-type-validator
此包的最新版本(1.0.1)没有可用的许可信息。
Laravel 压缩文件 MIME 类型验证器
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: 2024-09-22 12:42:43 UTC
README
用于验证 Laravel 压缩文件 MIME 类型的规则,以确保压缩文件只包含允许的文件类型。
安装
$ composer require hamaelt/zip-mime-type-validator
要求
- PHP 7.4 或更高版本
用法
在您的自定义请求类中使用 ZipMimeType 规则,并将所需的文件类型作为字符串传递。
use Hamaelt\ZipValidator\Rules\ZipMimeType;; public function rules() { return [ 'zip_file' => [ 'required',new ZipMimeType('pdf,jpg,png')], ]; }