我有一个上传器,如果不使用规则就能正常工作,但是当我创建规则时,会出现以下错误:
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() !!}
php.ini
中。我添加了它,然后它就起作用了。 - Vahid Amiri