'fontawesome the style dont work laravel 7

enter image description here

I work on Laravel 7 project , when i use fontawesome the icon don't work

i have the file in public directory then i used in app.blade.php

<link rel="stylesheet" href="{{asset('css/css/vendor/vendor.min.css')}}">

she don't work then i install the fontawesome with npm install @fortawesome/fontawesome-free command and npm install && npm run dev then npm run production but still don't work .

sass file

@import '~@fortawesome/fontawesome-free/scss/fontawesome';
@import '~@fortawesome/fontawesome-free/scss/regular';
@import '~@fortawesome/fontawesome-free/scss/solid';
@import '~@fortawesome/fontawesome-free/scss/brands';

any solution



Solution 1:[1]

Since you did npm run prod you should get an app.css or a file with CSS extension.

You can check in your webpack file, to findout, what is the output for CSS file.

In case you've done npm run prod base on default Laravel setup, you should get the app.css file in CSS directory, which in this case you can now use that file using below code :

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

Highly recommend to use mix() in this case, since you're using npm run production and getting output base on messing with CSS and JS files in resource directory.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1