I'm trying to include the Font Awesome toolkit in Laravel 5.7.
These are the steps I took:
1) Run npm install --save-dev @fortawesome/fontawesome-free
2) Check the folders in node_modules/
and everything looks OK.
$fa-font-path: "../webfonts";
// Bootstrap
@import '~bootstrap/scss/bootstrap';
@import '~@fortawesome/fontawesome-free/scss/fontawesome.scss';
@import '~@fortawesome/fontawesome-free/scss/solid.scss';
@import '~@fortawesome/fontawesome-free/scss/regular.scss';
@import '~@fortawesome/fontawesome-free/scss/brands.scss';
3) Then I ran...
npm run development -- --watch
4) I see files in public/fonts/vendor/@fortawesome/fontawesome-free/
.
However, when I go to the browser the icons look like this:
Laravel 5.7 through 6.x using Font Awesome 5 (The Right Way)
Build your webpack.mix.js configuration.
Install the latest free version of Font Awesome via a package manager like npm.
This dependency entry should now be in your package.json.
In your main SCSS file, /resources/sass/app.scss import one or more styles.
Compile your assets and produce a minified, production-ready build.
Finally, reference your generated CSS file in your Blade template/layout.
update your webpack.mix.js configuration as below:
type 'npm run dev' in your terminal and hit enter