lucasruroken/laravel-font-awesome

There is no license information available for the latest version (v1.0.0) of this package.

Helper class to build FontAwesome icons

This package's canonical repository appears to be gone and the package has been frozen as a result. Email us for help if needed.

Installs: 159

Dependents: 0

Suggesters: 0

Security: 0

Stars: 1

Watchers: 1

Forks: 0

pkg:composer/lucasruroken/laravel-font-awesome

v1.0.0 2016-09-02 12:53 UTC

This package is not auto-updated.

Last update: 2025-11-03 19:54:16 UTC


README

Helper class to create FontAwesome icons with a predefined markup. Bassed on Digbang\FontAwesome

This package allows you to create a facade in your laravel application. But if you want, you can use this package without laravel

Usage

Basic usage

$fa = new FontAwesome();
$fa->icon('icon', ['class' => 'extra-class'])

Basic usage Laravel 5.*

FontAwesome::icon('icon', ['class' => 'extra-class'])

Would result in...

<i class="fa fa-icon extra-class"></i>

HTML Attributes

You can also add any other attributes to the html. Doing...

$fa->icon('times', ['title' => 'Delete this!'])

would result in...

<i class="fa fa-times" title="Delete this!"></i>

Changing the tag

You can change the tag used by the library. Doing...

$fa->setTag('span');
$fa->icon('edit');

would result in...

<span class="fa fa-edit"></span>

Laravel

Add the service provider and facade to your config/app.php file:

'providers' => array(
	...
	'LucasRuroken\FontAwesome\FontAwesomeServiceProvider',
	...
);

And add the class alias, so you can call it like \FontAwesome::icon

'aliases' => array(
	...
	'FontAwesome' => 'LucasRuroken\FontAwesome\Facade',
	...
);