Anuruddha
5 months ago
1549
7
Laravel

Font Awesome not working with laravel 6 ( squares only )

Posted 5 months ago by Anuruddha

Hi Guys,

I installed font-awesome in a fresh laravel 6 installation using following npm command

npm install @fortawesome/fontawesome-free --save

But it shows squares instead of icons! I have the fonts folder in the public folder.

app.scss

//font awesome
@import '@fortawesome/fontawesome-free/scss/fontawesome.scss';
@import '@fortawesome/fontawesome-free/scss/regular.scss';
@import '@fortawesome/fontawesome-free/scss/solid.scss';
@import '@fortawesome/fontawesome-free/scss/brands.scss';

webpack.mix.js

mix.js('resources/js/app.js', 'public/js')
    .sass('resources/sass/app.scss', 'public/css')
    .copy('node_modules/@fortawesome/fontawesome-free/webfonts', 'public/webfonts')

package.json

    "dependencies": {
        "@fortawesome/fontawesome-free": "^5.12.0",
        "bootstrap-icons": "^1.0.0-alpha2"
    }

app.blade.php

    <!-- Styles -->
    <link href="{{ asset('css/app.css') }}" rel="stylesheet">

I compiled the assets

npm run dev

npm run watch

Please sign in or create an account to participate in this conversation.