Easily add Font Awesome icons using these simple Blade directives.
Simply require the package in your project. Supports Laravel 7 and above.
composer require djam90/laravel-font-awesome
That's it!
The service provider will be automatically registered and the blade directives are ready to use in your views.
There are 5 Blade directives made available with this package. These are to support the 5 different styles in Font Awesome:
- Solid (fas)
- Regular (far)
- Light (fal)
- Duotone (fad)
- Brand (fab)
@fas('user')
Will output:
<i class="fas fa-user"></i>
@far('user')
Will output:
<i class="far fa-user"></i>
@fal('user')
Will output:
<i class="fal fa-user"></i>
@fad('user')
Will output:
<i class="fad fa-user"></i>
@fab('500px')
Will output:
<i class="fab fa-500px"></i>
If you attempt to use an incompatible directive and icon combination, it simply will not work. An example would be @fab('user')
because there is no "user" brand icon.