public function render()
    {
        $this->setupDefaultOptions();

        if (!empty($this->value)) {
            $this->attribute('data-initial-preview', $this->preview());
            $this->attribute('data-initial-caption', $this->initialCaption($this->value));

            $this->setupPreviewOptions();
        }

        $this->options(['overwriteInitial' => true]);

        $options = json_encode($this->options);

        $this->script = <<<EOT

$("input{$this->getElementClassSelector()}").fileinput({$options});

EOT;

        return parent::render();
    }
public function render()
    {
        $this->setupDefaultOptions();

        if (!empty($this->value)) {
            $this->attribute('data-initial-preview', $this->preview());
            $this->attribute('data-initial-caption', $this->initialCaption($this->value));

            $this->setupPreviewOptions();
        }

        $this->options(['overwriteInitial' => true]);

        $options = json_encode($this->options);

        $this->script = <<<EOT

$("input{$this->getElementClassSelector()}").fileinput({$options});

EOT;

        return parent::render();
    }
public function render ( ) { $ this -> setupDefaultOptions ( ) ; if ( ! empty ( $ this -> value ) ) { $ this -> attribute ( 'data-initial-preview' , $ this -> preview ( ) ) ; $ this -> attribute ( 'data-initial-caption' , $ this -> initialCaption ( $ this -> value ) ) ; $ this -> setupPreviewOptions ( ) ; } $ this -> options ( [ 'overwriteInitial' => true ] ) ; $ options = json_encode ( $ this -> options ) ; $ this -> script =  <<<EOT

$("input{$this->getElementClassSelector()}").fileinput({$options});

EOT ; return parent :: render ( ) ; }
Render file upload field.

@return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
Render file upload field .