dwen's avatar
Level 3

Font awesome installed in the Laravel 10.20 project, but not showing up icon

to install fontawesome in local dev box of Laravel 10.20

npm install --save @fortawesome/fontawesome-free

can find C:\laragon\www\project-name\node_modules@fortawesome\fontawesome-free\css\all.css, so in the app.css

@import '~@fortawesome/fontawesome-free/css/all.css';

then run

npm run dev

in the home.blade.php, insert the following line to test fontawesome icon camera

<i class="fas fa-camera"></i>

but it does not show up camera icon, go to inspect and found

Failed to load resource: the server responded with a status of 404 (Not Found) all.css

not sure where is going wrong, checked here forum regarding Font awesome not helpful in my case!

0 likes
4 replies
dwen's avatar
Level 3

@Tray2 thanks for this URL, I am using Laravel's default frontend tool Laravel Mix, not sure if using vite would screw other things.

Tray2's avatar

@dwen Laravel 10 uses vite by default, so that is why I linked it.

Armani's avatar

@dwen You have to add these lines to app.scss:

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

Please or to participate in this conversation.