public function render()
{
$this->js[] = 'bootstrap-fileinput/js/fileinput_locale_' . config('app.locale') . '.js';
$this->options['initialCaption'] = basename($this->value);
if (!empty($this->value)) {
$this->options['initialPreview'] = $this->preview();
}
$options = json_encode($this->options);
$this->script = <<<EOT
\$("#{$this->id}").fileinput({$options});
\$("#{$this->id}").on('filecleared', function(event) {
\$("#{$this->id}_action").val(1);
});
EOT;
return parent::render();
}