djam90 / laravel-font-awesome
Laravel Blade directives to easily use Font Awesome icons.
Requires
- illuminate/support: ^7.0
Requires (Dev)
- orchestra/testbench: ^5.1
- phpunit/phpunit: ^8.0
This package is auto-updated.
Last update: 2024-10-29 23:15:05 UTC
README
Easily add Font Awesome icons using these simple Blade directives.
Installation
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.
Usage
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)
Examples
Solid
@fas('user')
Will output:
<i class="fas fa-user"></i>
Regular
@far('user')
Will output:
<i class="far fa-user"></i>
Light
@fal('user')
Will output:
<i class="fal fa-user"></i>
Duotone
@fad('user')
Will output:
<i class="fad fa-user"></i>
Brand
@fab('500px')
Will output:
<i class="fab fa-500px"></i>
Caveats
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.