-1

The Laravel application is not showing the glyphicons, because is shown the error "Failed to load resource: the server responded with a status of 404 (Not Found)"?

Solution:

$ mkdir public/css/fonts

$ cp node_modules/bootstrap-sass/assets/fonts/bootstrap/glyphicons-halflings-regular.ttf public/css/fonts/

$ cp node_modules/bootstrap-sass/assets/fonts/bootstrap/glyphicons-halflings-regular.woff public/css/fonts/

$ cp node_modules/bootstrap-sass/assets/fonts/bootstrap/glyphicons-halflings-regular.woff2 public/css/fonts/

neophyte
  • 6,540
  • 2
  • 28
  • 43
Allan Ederich
  • 11
  • 1
  • 2

3 Answers3

1

I had same problem, resolved this with adding

<link href="//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap-glyphicons.css" rel="stylesheet">
0

Try using the

public_path() 

function provided by Laravel, it'll handle getting the public path correctly on development and production.

If you're pulling in through a blade file, try

@font-face{
    font-family:'Glyphicons Halflings';
    src:url({{public_path() . '/css/fonts/<<nameOfFileHere>>'}});
}

Or you could use a CDN if having it locally isn't fully required.

<link href="//maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css" rel="stylesheet">
Oscar A Garcia
  • 173
  • 5
  • 18
0

Glyphicons weren't working for me on laravel 7 and I found this article very useful. It explains how to add Glyphicons for laravel in very simple manner.

How to use Glyphicons with a Laravel project

But I had to do a small change for get this working.

$icon-font-path: '../fonts/bootstrap/';

to

$icon-font-path: "~bootstrap-sass/assets/fonts/bootstrap/";
vimuth
  • 5,064
  • 33
  • 79
  • 116