devlop/fontawesome-blade

Laravel Blade Components for Font Awesome

3.1.0 2023-03-03 05:26 UTC

This package is auto-updated.

Last update: 2024-11-30 02:13:40 UTC


README

Latest Stable Version License

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';