1

These are my folders:

app
--->views
------->css
----------->font-awesome.css
----------->index.css
------->layouts
----------->restaurants.blade.php
------->restaurants
----------->create.blade.php

in restaurants.blade.php I tried this:

<link rel="stylesheet" href="{{ URL::asset('views/css/index.css') }}" />
        {{ HTML::style('views/css/font-awesome.css') }}

in both way, I got this exception:

http://localhost:8082/ProjectName/public/views/css/index.css 404 (Not Found)

http://localhost:8082/ProjectName/public/views/css/font-awesome.css 404 file not found

Could you help please?

2 Answers 2

3

Your assets are stored under your views, but you are linking to public.

Put the assets that you need to load (css, imgs, js) under public. Then you can simply

{{asset('css/style.css')}}

for example.

Also make sure your config/app.php document root is setup right, and if using apache, make sure that your vhost is setup properly to where /public/ is your Document Root.

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

4 Comments

The same error message but the url is http://localhost:8082/ParkingProject/public/css/index.css 404 not found so I guess that I need to put view
I can see the html, so the configuration is correct, right?
Did you relocate your css into public properly? It should not be in a view a folder. If you want asset('css/index.css') to work, the file should be located in /public/css/index.css What are you using to host? php artisan serve?
when I moved the css folder to my public folder, it works. thanks
0

For using laravel with Vite

@vite("resources/css/app.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.