Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

t0berius's avatar

blade include .css

What's the default place to store .css files for views and how can I include them into my blade template? My current view "test.blade.php" for example is located in "\resources\views\invoices".

I would like to set all .css files into "\resources\views\invoices\assets". How can I call them into my view in the best way? Any built in functions in blade to do so?

0 likes
3 replies
Snapey's avatar

Your css files need to be in /public so that a browser can request them. Most have a /public/css folder

mehany's avatar

maybe /public/css/invoices

edit: You can structure your sass or less files :

 app.scss
    admin
        invoices
            layout.scss
 .....

then mix everything to the public folder

1 like
Joeri's avatar

Include in the header like

<link rel="stylesheet" type="text/css" href="{{ asset('/css/<NAME>.css') }}" />

I added also a @yield('addCss') in the main layout so i can add css that is only for that page. I also recommend using Sass more info for sass you can find here: https://laravel.com/docs/5.1/elixir#introduction

Please or to participate in this conversation.