src/Bootstrap/Traits/BuildsStylesAndScripts.php
public function js(array $dependencies = ['jquery.slim', 'popper'])
    {
        $dependencies[] = 'bs4';
        $urls = collect([
            'jquery'      => 'https://code.jquery.com/jquery-' . config('bs4.versions.jquery') . '.min.js',
            'jquery.slim' => 'https://code.jquery.com/jquery-' . config('bs4.versions.jquery') . '.slim.min.js',
            'popper'      => 'https://cdnjs.cloudflare.com/ajax/libs/popper.js/' . config('bs4.versions.popper') . '/umd/popper.min.js',
            'bs4'         => self::$BS4_CDN . config('bs4.versions.bootstrap') . '/js/bootstrap.min.js',
        ]);

        return $this->html->div()->addChildren(
            $urls
                ->filter(function ($value, $key) use ($dependencies) {
                    return \in_array($key, $dependencies, true);
                })
                ->map(function ($v) {
                    return $this->mapScriptElement($v);
                }));
    }
public function js(array $dependencies = ['jquery.slim', 'popper'])
    {
        $dependencies[] = 'bs4';
        $urls = collect([
            'jquery'      => 'https://code.jquery.com/jquery-' . config('bs4.versions.jquery') . '.min.js',
            'jquery.slim' => 'https://code.jquery.com/jquery-' . config('bs4.versions.jquery') . '.slim.min.js',
            'popper'      => 'https://cdnjs.cloudflare.com/ajax/libs/popper.js/' . config('bs4.versions.popper') . '/umd/popper.min.js',
            'bs4'         => self::$BS4_CDN . config('bs4.versions.bootstrap') . '/js/bootstrap.min.js',
        ]);

        return $this->html->div()->addChildren(
            $urls
                ->filter(function ($value, $key) use ($dependencies) {
                    return \in_array($key, $dependencies, true);
                })
                ->map(function ($v) {
                    return $this->mapScriptElement($v);
                }));
    }
Link to the latest font-awesome CSS served from maxcdn.bootstrapcdn.com

@param array $dependencies Dependencies to load before the BS4 script. ['jquery', 'jquery.slim', 'popper' ]

@return \Spatie\Html\Elements\Element