Okay--I know this is a really elementary issue, but I can't figure it out. This is a question regarding Laravel.
Basically, I have my stylesheets embedded in my default layout view. I'm currently just using regular css to link them, such as:
<link rel="stylesheet" href="css/app.css" />
It works great when I am at a single level route such as /about, but stops working when I go deeper, such as /about/me.
If I look at Chrome's developer console I see some of the following errors (only for the deeper routes):
Resource interpreted as Stylesheet but transferred with MIME type text/html: "http://example.dev/about/css/app.css".
So clearly it is now looking for the css inside the "about" folder--which of course isn't a folder at all.
I just want it to look in the same place for the assets regardless of the route.
Try using Mix to copy the assets from the /vendor dirs to your /public dirs (ie /public/css and /public/js). Then use those paths for your assets in the html. Don't think you should be loading assets from the vendor dir.
Where is mix js laravel? Consider a typical Laravel install. By default, your JavaScript entry point will be located at ./resources/js/app.
For Laravel 4 & 5:
<link rel="stylesheet" href="{{ URL::asset('assets/css/bootstrap.min.css') }}">
URL::asset
will link to your project/public/
folder, so chuck your scripts in there.
.blade.php
extension.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With