Skip to content

Instantly share code, notes, and snippets.

@elizov
Last active June 17, 2020 08:24
Show Gist options
  • Save elizov/93692483bf8bc43ad90c9b415024335a to your computer and use it in GitHub Desktop.
Save elizov/93692483bf8bc43ad90c9b415024335a to your computer and use it in GitHub Desktop.
<?php
namespace App\Http\Requests;
use App\Rules\MaxVideoBitRate;
use Illuminate\Foundation\Http\FormRequest;
class VideoUploadRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*
* @return bool
*/
public function authorize()
{
return true;
}
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public function rules()
{
return [
'video' => [
'bail',
'mimetypes:video/*',
new MaxVideoBitRate(12000000),
],
];
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment