Help us understand the problem. What is going on with this article?

Laravel+FontAwesomeの使い方

More than 1 year has passed since last update.

Laravel+FontAwesomeの使い方

バージョン

  • Laravel: 5.6
  • node: v8.11.4
  • npm: 5.6.0
  • fontawesome-free: 5.3.1

前提条件

  • Laravelのセットアップが完了していること
  • npm installでjavascriptの初期パッケージがインストール済みであること

参考: https://readouble.com/laravel/5.6/ja/mix.html

FontAwesomeのインストール

npmでインストールします

cd /path/to/laravel-project
npm install @fortawesome/fontawesome-free --save-dev

Webpackの設定

resouces/assets/sass/app.scss
// Font Awesome
@import '~@fortawesome/fontawesome-free/scss/fontawesome';
@import '~@fortawesome/fontawesome-free/scss/solid';
@import '~@fortawesome/fontawesome-free/scss/regular';
@import '~@fortawesome/fontawesome-free/scss/brands';

solid, regular, brands は必要なものだけでもOK

アセットコンパイル

npm run dev

使用方法

下記のサイトで適当なアイコンを探してテンプレートに張り付ける
https://fontawesome.com/icons?d=gallery

*.blade.php
<i class="fas fa-check"></i>
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
No comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
ユーザーは見つかりませんでした