init: function () {
@if(isset($user) && $user->picture)
var file = {!! json_encode($user->picture) !!}
this.options.addedfile.call(this, file)
this.options.thumbnail.call(this, file, file.preview)
file.previewElement.classList.add('dz-complete')
$('form').append('<input type="hidden" name="picture" value="' + file.file_name + '">')
var preview = document.createElement('a');
preview.setAttribute('href',file.preview);
preview.setAttribute('target','_blank');
preview.setAttribute('class','fa fa-file');
preview.innerHTML = " Preview";
file.previewTemplate.appendChild(preview);
this.options.maxFiles = this.options.maxFiles - 1
@endif
},