devlop / fontawesome-blade
Laravel Blade Components for Font Awesome
3.1.0
2023-03-03 05:26 UTC
Requires
- php: ^7.4|^8.0
- ext-mbstring: *
- laravel/framework: ^7.0|^8.0|^9.0|^10.0
Requires (Dev)
- devlop/phpunit-exception-assertions: ^1.0
- orchestra/testbench: ^6.17
- phpunit/phpunit: ^9.5
- symfony/var-dumper: ^5.2
README
Font Awesome Blade
A collection of Laravel Blade Components to make it dead simple to use the Font Awesome icons in Laravel.
Prerequisites
This package assumes that you are using Font Awesome via a package manager.
Installation
composer require devlop/fontawesome-blade
Configuration
By default this package will assume you are using the @fortawesome/fontawesome-free
.
If you are using any other version, publish the configuration and change the path accordingly.
php artisan vendor:publish --provider="Devlop\FontAwesome\FontAwesomeBladeServiceProvider"
Usage
Each of Font Awesome's different styles are available as separate components, they all accept the same name
argument for specifying which icon to display.
<x-fa::brands name="fa-laravel" /> <x-fa::solid name="fa-0" /> <x-fa::regular name="fa-2" /> <x-fa::light name="fa-5" /> <x-fa::thin name="fa-0" /> <x-fa::duotone name="fa-elephant" />
You also need to import the Font Awesome CSS into your CSS build to get the icons to display like they would if you were using the Font Awesome JS method.
@import '@fortawesome/fontawesome-pro/css/svg-with-js.css';