I hate asking what appear to be dumb questions. All I want is something like "base_url" in Codeigniter so that I can create an app/assets directory and add my css, js, and images.
Stackoverflow thinks I should put it in the public directory ... don't want that. I have hunted thorugh the L4 docs at the various helpers and can't see anything that works.
Jeffrey's Larabook lesson magically has it but I could not see how he did it.
It would be great if come L5 there was a review of the docs. CI is a weak framework for sure, but their docs are outstanding.
There is no built in compiler/compressor, so if you want it inside app/assets, use Elixir or Basset. Both can compile and compress your assets to the public directory.
Not using preprocessors - just pulling in Bootstrap css. Just want to be able to access
app/assets/css like Jeffrey has have in Larabook. Then I want to be able to do something like:
Why are you placing your CSS files in your app directory? It's meant to be in the public directory as that's what is pointed to the browser.
If your structure was
public /
css /
- bootstrap.css
then you can use asset('css/bootstrap.css') to generate an absolute path to the file. If you were using pre-processors, then you would want to place that in your app directory and have it compile into the public directory.
You cannot link to files inside of ~/app, the application is pointed to ~/public
Ok - I see what you are saying. Unlike Codeigniter, the app directory is reserved for uncompiled code. Compiled code lives in the public directory. Now it makes sense.
ok, so I put my css into the public folder and then so tried
Since there is NotFoundHttpException thrown, the route is not registered. Since Laravel is trying to resolve registered route (with no luck, of course) there is no actual CSS file to load - which would be served if existed. Examine the directory strcture and make sure CSS is in right location
It's the same in any website/framework? Since your site is pointing to the public folder, only files inside that folder can be seen on the frontend (unless you do PHP includes).
Yes, looking at my Codeigniter work, indeed the css folder is outside the application folder. Perhaps looking at Jeffrey's Larabook series where he has an assets folder inside App/ threw me. Additionally there is little mention of how to exactly expose your assets in the L4 docs ... at least that's my excuse :o)