How to add fontawesome 5 in laravel mix

How to add fontawesome 5 in laravel mix

For installing Font Awesome 5 (webfont with css) with Laravel mix we need to install npm first. You can use solution 2 in this post to do that.

After npm installed successfully run code below in your terminal

npm i --save @fortawesome/fontawesome-free

Next import font awesome scss in app.scss or your custom scss file

@import '[email protected]/fontawesome-free/scss/brands';
@import '[email protected]/fontawesome-free/scss/regular';
@import '[email protected]/fontawesome-free/scss/solid';
@import '[email protected]/fontawesome-free/scss/fontawesome';

Next compile your assets npm run dev or npm run production and include your compiled css into layout like:

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


That's it. Now you can use latest version of fontawesome in your application.


Leave a comment

Enjoy this?

Subscribe our newsletter and get latest updates straight to your inbox.