For a fresh Font Awesome installation, follow these steps:
Install Font Awesome via npm:
First, run the following command in your project directory:
npm install --save @fortawesome/fontawesome-free
Import Font Awesome in app.css:
Open your app.css file (or equivalent) and add the following line at the very top:
@import '@fortawesome/fontawesome-free/css/all.css';
Use Font Awesome icons in your Blade files:
Add an icon to your Blade view, like this:
<i class="fas fa-home"></i>
Run npm run dev:
To build and check if everything is working properly, run:
npm run dev
If you run into any issues with your Node.js version, your terminal should inform you if the version is incompatible. In my case, I had to switch to v22.11.0 to resolve compatibility problems.
Font Awesome should work seamlessly in both development and production environments.