2

I am using fontawesome in my laravel project, the problem is that it will not display if I use it in local without using CDN.

<link href="{{ URL::asset('css/font-awesome.min.css') }}" rel='stylesheet' type='text/css'>

NetworkError: 404 Not Found - http://localhost/mysite/fonts/fontawesome-webfont.woff2?v=4.6.3"

"NetworkError: 404 Not Found - http://localhost/mysite/fonts/fontawesome-webfont.woff?v=4.6.3"

NetworkError: 404 Not Found - http://localhost/mysite/fonts/fontawesome-webfont.ttf?v=4.6.3

here is my fullpath of font-awesome.min.css

C:\wamp\www\mysite\public\css\

Thank you in advance.

jemz
  • 4,987
  • 18
  • 62
  • 102

1 Answers1

3

This is because you are using the URL helpers incorrectly.

If font-awesome.min.css is inside public/css then you want to be referencing it just using the asset() helper - you do not need to add the URL facade too.

So just tweak your <link> tag a little like so:

<link href="{{ asset('css/font-awesome.min.css') }}" rel='stylesheet' type='text/css'>
James
  • 15,754
  • 12
  • 73
  • 91