Skip to content

minuteoflaravel/laravel-csv-validator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Laravel CSV Validator

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.

About

Adds CSV validator to your Laravel project

Resources

License

Stars

Watchers

Forks

Sponsor this project

 

Packages

No packages published

Languages