Luke Sweeney Luke Sweeney - 1 month ago 6
CSS Question

Laravel won't link stylesheet

I'm using Laravel 5.2.

I have

public/app.css
and i link it from
views/layouts/app.blade.php
with:

<link rel="stylesheet" href="{{ public_path('app.css') }}">


I have tried every combination that i can think of, like using
asset()
asset_path()
, putting
app.css
in
views/layouts/
with the app.blade.php file and nothing will work.

If I inspect the source of a page, it shows the link and the path is correct, but the styles won't apply.

Answer

Try to use asset() method:

<link rel="stylesheet" href="{{ asset('app.css') }}">