phpvms/app/Http/Requests/ImportRequest.php

32 lines
594 B
PHP
Raw Normal View History

2018-03-23 06:17:37 +08:00
<?php
namespace App\Http\Requests;
use App\Contracts\FormRequest;
2018-03-23 06:17:37 +08:00
use Illuminate\Http\Request;
/**
* Validate that the files are imported
*/
class ImportRequest extends FormRequest
{
public static $rules = [
2018-08-27 00:40:04 +08:00
'csv_file' => 'required|file',
2018-03-23 06:17:37 +08:00
];
/**
* @param Request $request
2018-08-27 00:40:04 +08:00
*
2018-03-23 06:17:37 +08:00
* @throws \Illuminate\Validation\ValidationException
*/
public static function validate(Request $request)
{
\Validator::make($request->all(), static::$rules)->validate();
}
public function rules(): array
{
return static::$rules;
}
}