owenvoke/blade-fontawesome

A package to easily make use of Font Awesome in your Laravel Blade views

v1.9.0 2021-05-10 14:00 UTC

This package is auto-updated.

Last update: 2021-06-28 16:12:25 UTC


README

Latest Version on Packagist Software License Build Status Style CI Total Downloads Buy us a tree

A package to easily make use of Font Awesome in your Laravel Blade views.

For a full list of available icons see the SVG directory.

Requirements

  • PHP 7.4 or higher
  • Laravel 8.0 or higher

Install

Via Composer

$ composer require owenvoke/blade-fontawesome

Configuration

Blade Font Awesome also offers the ability to use features from Blade Icons like default classes, default attributes, etc. If you'd like to configure these, publish the blade-fontawesome.php config file:

php artisan vendor:publish --tag=blade-fontawesome-config

Usage

Icons can be used a self-closing Blade components which will be compiled to SVG icons:

<x-fas-cloud/>

You can also pass classes to your icon components:

<x-fas-cloud class="w-6 h-6 text-gray-500"/>

And even use inline styles:

<x-fas-cloud style="color: #555"/>

Raw SVG Icons

If you want to use the raw SVG icons as assets, you can publish them using:

php artisan vendor:publish --tag=blade-fontawesome --force

Then use them in your views like:

<img src="{{ asset('vendor/blade-fontawesome/solid/cloud.svg') }}" width="10" height="10"/>

Font Awesome Pro

Blade Font Awesome supports pro icons using npm for downloads.

To use this, install Font Awesome Pro using npm i --save @fortawesome/fontawesome-pro, and then run the following Artisan command to add the icons to your resources path.

php artisan blade-fontawesome:sync-pro

Blade Font Awesome will then automatically detect and use the pro icons under the resources/icons/blade-fontawesome path.

Blade Icons

Blade Font Awesome uses Blade Icons under the hood. Please refer to the Blade Icons readme for additional functionality.

Change log

Please see CHANGELOG for more information on what has changed recently.

Testing

$ composer test

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email security@voke.dev instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.

Treeware

You're free to use this package, but if it makes it to your production environment you are required to buy the world a tree.

It’s now common knowledge that one of the best tools to tackle the climate crisis and keep our temperatures from rising above 1.5C is to plant trees. If you support this package and contribute to the Treeware forest you’ll be creating employment for local families and restoring wildlife habitats.

You can buy trees here.

Read more about Treeware at treeware.earth.