PHP code example of minuteoflaravel / laravel-audio-video-validator

1. Go to this page and download the library: Download minuteoflaravel/laravel-audio-video-validator library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

minuteoflaravel / laravel-audio-video-validator example snippets


  'audio' => 'The :attribute must be a audio.',
  'video' => 'The :attribute must be a video.',
  'codec' => 'The :attribute codec must be one of these: :codec',
  'duration' => 'The :attribute must be :duration seconds duration.',
  'duration_max' => 'The :attribute duration must be less than :duration_max seconds.',
  'duration_min' => 'The :attribute duration must be greater than :duration_min seconds.',
  'video_width' => 'The :attribute width must be :video_width.',
  'video_height' => 'The :attribute height must be :video_height.',
  'video_max_width' => 'The :attribute width must be less than :video_max_width.',
  'video_min_width' => 'The :attribute width must be greater than :video_min_width.',
  'video_min_height' => 'The :attribute height must be greater than :video_min_height.',

$request->validate([
    'audio' => 'audio|duration:60',
]);

$request->validate([
    'audio' => 'audio|duration_min:30|duration_max:300',
]);

$request->validate([
    'video' => 'video|duration_min:30|duration_max:300',
]);

$request->validate([
    'video' => 'video|video_width:1000|video_height:640',
]);

$request->validate([
    'video' => 'video|video_min_width:1000|video_min_height:640',
]);

$request->validate([
    'audio' => 'audio|codec:mp3,pcm_s16le',
]);

$request->validate([
    'video' => 'video|codec:h264',
]);