2

I can't use the app.css in my application I use <link href="{{asset('css/app.css')}}" rel="stylesheet" type="text/css">

2
  • did you try compiling your assets? npm run dev or npm run watch Commented Jun 19, 2022 at 8:29
  • @vite("resources/css/app.css") Commented Feb 12, 2023 at 2:12

3 Answers 3

4

By default the asset() helper starts with the /public folder. If you have already taken this into consideration then the only problem will be that you have not run npm run dev.

public/
    |--- css/app.css
    |---js/

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

Sign up to request clarification or add additional context in comments.

Comments

0

Check your asset url in .env file. If it is missing add it in your .env file

ASSET_URL=public

and run php artisan config:cache.

Comments

-1

if

public/
    |--- css/app.css
    |---js/

and

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

not work you can use

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

or you can use

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.