Download the PHP package minuteoflaravel/laravel-audio-video-validator without Composer
On this page you can find all versions of the php package minuteoflaravel/laravel-audio-video-validator. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download minuteoflaravel/laravel-audio-video-validator
More information about minuteoflaravel/laravel-audio-video-validator
Files in minuteoflaravel/laravel-audio-video-validator
Package laravel-audio-video-validator
Short Description Laravel validator for video and audio files
License MIT
Homepage https://github.com/minuteoflaravel/laravel-audio-video-validator
Informations about the package laravel-audio-video-validator
Laravel Audio & Video Validator
This package adds validators for audio and video files to your Laravel project.
Installation
To use this package you should intall ffmpeg multimedia framework:
- On Debian/Ubuntu, run
- On macOS with Homebrew:
After that install the package via composer:
Validators
Package adds these validators:
- audio
- video
- codec
- duration
- duration_max
- duration_min
- video_width
- video_height
- video_max_width
- video_max_height
- video_min_width
- video_min_height
Custom error messages
If you need to add your custom translatable error messages then just add them as always to resources/lang/en/validation.php file:
Some examples
To check if file is audio file and audio duration is 60 seconds:
To check if file is audio file and audio duration is between 30 and 300 seconds:
To check if file is video file and video duration is between 30 and 300 seconds:
To check if file is video file and video dimensions are 1000x640:
To check if file is video file and video dimensions greater than 1000x640:
To check if file is audio file and codec is mp3 or pcm_s16le(wav):
To check if file is video file and codec is h264(mp4):
License
The MIT License (MIT). Please see License File for more information.