samedi 2 décembre 2017

List JS and CSS Files From Multiple Directories

I'm trying to include a number of CSS and JS files in a project. By "a number of" I mean somewhere between ten and thirty each. What I'd like to do is create an array that locates each JS and CSS file specifically from several directories which I can then print out within the app.blade.php file (I'm using Laravel 5.5).

I started off with:

@foreach(Storage::files('/plugins') as $file)
    <script type="text/javascript" src="{!! asset($file) !!}"></script>
@endforeach

It returns absolutely nothing. It also occurred to me that it'll print absolutely everything within the folder but nothing from the sub-directories; if it worked at all.

I'm at a loss as where to go from here. My searches have brought me across the same solution which prints everything from a specific directory.

For those wondering why I would be insane enough to try to include so many CSS and JS files: I'm testing plugins and I want to make sure all the JS and CSS work together, rather than conflict, no matter which ones are used in any order.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire