Laravel 5 - 验证哑剧类型
我有一个没有规则的上传器工作正常,但是当我创建规则时,我得到错误:
LogicException in MimeTypeGuesser.php line 127:
Unable to guess the mime type as no guessers are available
(Did you enable the php_fileinfo extension?)
我的文章请求规则
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public function rules()
{
return [
'Image' => 'required|mimes:jpeg'
];
}
我的表格
{!! Form::open(['url' => 'blog', 'files'=> true]) !!}
<div class="form-group">
{!! Form::label('Image', 'Upload:') !!}
{!! Form::file('Image', null, ['class' => 'form-control']) !!}
</div>
<div class="form-group">
{!! Form::submit('Submit', ['class' => 'btn btn-primary form-control']) !!}
</div>
{!! Form::close() !!}