Failed to access Bower directory in Laravel directory

I recently started using Bower (or trying!) To manage packages in my Laravel 4 application. The two main ones are Bootstrap and jQuery.

My footer using Blade:

{{HTML::script('bower_components/jquery/jquery.min.js')}} {{HTML::script('packages/bootstrap/css/js/bootstrap.min.js')}} 

Display link: http://localhost:8888/bower_components/jquery/jquery.min.js , which is true.

The "packages" folder is available, but it cannot find the thing inside the bower_components directory. I set permissions for -R 755 in the bower_components directory, but it is still not available.

Any help would be greatly appreciated.

+6
source share
2 answers

It does not appear to be downloading these packages.

I do not like this default bower_components folder. Here is how I use it:

I have a .bowerrc file that says where the assets should be located:

 { "directory": "public/assets/vendor" } 

I ran

 bower init 

And every time I install something:

 bower install jquery -S 

Download, install and add them to the bower.json file:

 { "name": "MySite", "dependencies": { "jquery": "~2.0.3", "bootstrap": "~3.0.3", "font-awesome": "~4.0.3", "datatables": "~1.9.4" } } 

I am sure the files have been downloaded and installed:

 ls -la public/assets/vendor 

Then I just need to create my routes using:

 {{ HTML::style('assets/vendor/bootstrap/dist/css/bootstrap.min.css') }} {{ HTML::style('assets/vendor/font-awesome/css/font-awesome.min.css') }} {{ HTML::script('assets/vendor/jquery/jquery.min.js') }} 

I really don’t really understand permissions, because files should be easily read by the web server, and they usually are.

+12
source

I created the .bowerrc folder in the root directory and added the following code:

 { "directory": "public/bower_components" } 

Then I created bower.json using the bower init command.

Then I installed both packages, jQuery and Bootstrap, and outlined them as such:

 {{HTML::script('bower_components/jquery/jquery.min.js')}} {{HTML::script('bower_components/bootstrap/dist/js/bootstrap.min.js')}} 
+6
source

All Articles