minuteoflaravel/laravel-csv-validator
最新稳定版本:1.0.4
Composer 安装命令:
composer require minuteoflaravel/laravel-csv-validator
包简介
Adds CSV validator to your Laravel project
README 文档
README
This package adds a CSV validator to your Laravel project. This validator parses uploaded file using parsecsv/php-parsecsv library and validation is passed when there are no errors during parsing.
This package doesn't validate against a MIME type or file extension.
Installation
You can install package via composer:
composer require minuteoflaravel/laravel-csv-validator
Example
Check if a file has a CSV format:
$request->validate([ 'uploaded_file' => 'csv', ]);
Custom error messages
If you need to add your custom translatable error message then just add it as always to resources/lang/en/validation.php file:
'csv' => 'The :attribute must be a CSV file.',
License
The MIT License (MIT). Please see License File for more information.
统计信息
- 总下载量: 10.65k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 17
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2022-01-03