Using theme with laravel

1

Well, I need to use a theme but I'm not understanding where I should put the files, besides I'm having problems with importing the css files, actually the files I'm putting inside views. My folder structures are as follows:

-resources
-css
-errors
-fonts
-img
-less
-media
-vendor
-vendors
-index.blade.php (Pagina index onde tem o html base)
-meio.blade.php (Pagina onde tem o conteúdo da pagina principal.)

I'm importing the files as follows in the index.blade.php page

 <link href="/../resources/views/vendors/bower_components/animate.css/animate.min.css" rel="stylesheet">

The error you are giving is this in console.log of the browser:

  

Failed to load resource: the server responded with a status of 404 (Not Found)

How should I get my folder structures to recognize css, and to better split the project?

    
asked by anonymous 10.07.2016 / 04:28

2 answers

2
  

Files of this type are only accessible within the public folder.

Put your files inside the public folder, for example:

public/css
public/images
public/fonts
public/js

Then you can call them within your views, like this:

{{ HTML::script('js/animate.css/animate.min.css'); }}

{{ HTML::style('css/style.css'); }}

The ideal is to compact and minimize these files in a single, thus reducing the number of requests that the browser makes to look for the dependencies of your site increasing the loading speed of the site.

The laravel already comes with the integrated laravel-elixir, which facilitates these types of tasks, I recommend that you see the documentation official on this subject.

    
11.07.2016 / 19:37
1

By studying a bit I understood that css, img, and others files that are part of a structure should be in the public part, as these will be the data that will actually be published.

Once this is done I can use my entire layout in a normal way.

So the ideal is:

  

Files with css / js / img folders should be located on the 'public' page of the project.

    
10.07.2016 / 04:43