2017 © Pedro Peláez
 

library laravel-media-validator

A Laravel validator for audio and video files.

image

typidesign/laravel-media-validator

A Laravel validator for audio and video files.

  • Tuesday, October 10, 2017
  • by sdebacker@gmail.com
  • Repository
  • 2 Watchers
  • 1 Stars
  • 26 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 13 % Grown

The README.md

Add validation rules for audio and videos files.

This package gives your Laravel app a validator for audio and video files based on the information returned by ffprobe, wich is part of the FFmpeg project., (*1)

Why this package?

Because Symfony’s MIME types guessing is often not reliable, especially for audio files (see https://github.com/symfony/symfony/issues/8678)., (*2)

Installation

First install ffmpeg: - On Debian/Ubuntu, run sudo apt install ffmpeg - On macOS with Homebrew: brew install ffmpeg, (*3)

Then you can install the package via composer:, (*4)

composer require typidesign/laravel-media-validator

Usage

In your controller or anywhere you validate your data, add this rule:, (*5)

$request->validate([
    'audio' => [
        new IsAudio(['mp3', 'aac']),
        // …
    ],
]);

or this, for videos:, (*6)

$request->validate([
    'audio' => [
        new IsVideo(['h264', 'theora']),
        // …
    ],
]);

Changelog

Please see CHANGELOG for more information on what has changed recently., (*7)

Contributing

Please see CONTRIBUTING for details., (*8)

Security

If you discover any security related issues, please email samuel@typidesign.be instead of using the issue tracker., (*9)

Credits

About Typi Design

Typi Design is a webdesign agency based in Brussels, Belgium., (*10)

License

The MIT License (MIT). Please see License File for more information., (*11)

The Versions

10/10 2017

dev-master

9999999-dev https://github.com/typidesign/laravel-media-validator

A Laravel validator for audio and video files.

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel validator validation audio video media codec typidesign

10/10 2017

1.0.0

1.0.0.0 https://github.com/typidesign/laravel-media-validator

A Laravel validator for audio and video files.

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel validator validation audio video media codec typidesign