I have an uploader that works fine without rules, but when i create a rule i get the error:
LogicException in MimeTypeGuesser.php line 127:
Unable to guess the mime type as no guessers are available
(Did you enable the php_fileinfo extension?)
My article request rules
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public function rules()
{
return [
'Image' => 'required|mimes:jpeg'
];
}
My form
{!! 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() !!}
You should enable the following line in your php.ini and then restart your apache
extension=php_fileinfo.dll
Enabling mean just uncomment the line in your php.ini file
i.e., From this ;extension=php_fileinfo.dll
to extension=php_fileinfo.dll
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With