Laravel: Font Awesome 5

Assalamualaikum / Hi,

Today, I’m going to share how to include the new Font Awesome 5 in your Laravel application. You will need Node.js to do so – see Laravel Mix.

So to start with let’s, consider that you have your fresh Laravel application created, you need to install all front-end dependencies then install Font Awesome 5.

Create resources/assets/js/font-awesome.js and in resources/assets/js/font-awesome.js add the following:

Next, in webpack.mix.js, add the following:

In terminal run npm run production.

Once you’re done, you may use Font Awesome 5 in your application. See Font Awesome 5 for the icons available.

Please take note, this is for free Font Awesome 5. For Pro, you just need the license key and replace the word `free` to `pro` during installing the package

Training on Web Development with Laravel Framework (Advanced) at Barracuda Campus, Cyberjaya (08 Feb 2018). Interested to learn? Check out our website at Cleanique Coders or email us for further enquiry.

8 thoughts on “Laravel: Font Awesome 5

    1. You are right Evan! I have those error you mentioned.

      I’ve tried using `import`, and it works. I will update my post afterwards.

  1. Thanks for the lot of my time..i have a question..
    whats the different putting ” .js(‘resources/assets/js/font-awesome.js’, ‘public/js’) ” inside webpack.mix.js instead putting ” require(‘./font-awesome’); ” inside js/app.js

  2. This guide doesn’t work anymore with the new FA implmenentation. Can you please update the guide with the new implemtation? Thanks.

      1. If you run npm update your packages won’t work anymore. FA adopted new packagenames, which makes the ‘old’ packages don’t work anymore. I temporary fixed it by including fontawesome in my header, but your NPM way was better I think. So an update would be nice.

Leave a Reply

Your email address will not be published. Required fields are marked *

seven + 4 =