public function javascriptIncludeTag($sources = "application", $attributes = [])
    {
        // E.g. javascript_include_tag('app'); => app-9fcd9b50e5cb047af35d3c5a4b55f73f.js
        $args = func_get_args();
        if (is_array(last($args))) {
            $attributes = array_pop($args);
        } else {
            $attributes = [];
        }
        $sources = is_array($sources) ? $sources : $args;
        if (empty($sources)) {
            $sources = ["application"];
        }

        $assetsOptions = ['host' => array_pull($attributes, 'host', $this->assetsHost)];

        $defaults = ['type' => 'text/javascript'];
        $attributes = $attributes + $defaults;

        $javascript_tags = [];
        foreach ((array) $sources as $source) {
            $sourceName = "$source.js";
            $javascript_tags[] = app('html')->script($this->assetPath($sourceName, $assetsOptions), $attributes);
        }

        return implode($javascript_tags);
    }
public function javascriptIncludeTag($sources = "application", $attributes = [])
    {
        // E.g. javascript_include_tag('app'); => app-9fcd9b50e5cb047af35d3c5a4b55f73f.js
        $args = func_get_args();
        if (is_array(last($args))) {
            $attributes = array_pop($args);
        } else {
            $attributes = [];
        }
        $sources = is_array($sources) ? $sources : $args;
        if (empty($sources)) {
            $sources = ["application"];
        }

        $assetsOptions = ['host' => array_pull($attributes, 'host', $this->assetsHost)];

        $defaults = ['type' => 'text/javascript'];
        $attributes = $attributes + $defaults;

        $javascript_tags = [];
        foreach ((array) $sources as $source) {
            $sourceName = "$source.js";
            $javascript_tags[] = app('html')->script($this->assetPath($sourceName, $assetsOptions), $attributes);
        }

        return implode($javascript_tags);
    }
public function javascriptIncludeTag ( $ sources = "application" , $ attributes = [ ] ) { // E.g. javascript_include_tag('app'); => app-9fcd9b50e5cb047af35d3c5a4b55f73f.js $ args = func_get_args ( ) ; if ( is_array ( last ( $ args ) ) ) { $ attributes = array_pop ( $ args ) ; } else { $ attributes = [ ] ; } $ sources = is_array ( $ sources ) ? $ sources : $ args ; if ( empty ( $ sources ) ) { $ sources = [ "application" ] ; } $ assetsOptions = [ 'host' => array_pull ( $ attributes , 'host' , $ this -> assetsHost ) ] ; $ defaults = [ 'type' => 'text/javascript' ] ; $ attributes = $ attributes + $ defaults ; $ javascript_tags = [ ] ; foreach ( ( array ) $ sources as $ source ) { $ sourceName = "$source.js" ; $ javascript_tags [ ] = app ( 'html' ) -> script ( $ this -> assetPath ( $ sourceName , $ assetsOptions ) , $ attributes ) ; } return implode ( $ javascript_tags ) ; }
Returns an HTML script tag for the sources and attributes specified as arguments.

@param  array|string  $sources default "application"
@param  array   $attributes HTML attributes
@return string
Returns an HTML script tag for the sources and attributes specified as arguments .