PHPackages                             digbang/fonts - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. digbang/fonts

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

digbang/fonts
=============

Helpers to build icons for multiple (and custom) sources.

v1.0.0(4y ago)032.2k↓40.6%1MITPHPPHP ^7.4 || ^8.0.2

Since Mar 23Pushed 4y ago39 watchersCompare

[ Source](https://github.com/digbang/fonts)[ Packagist](https://packagist.org/packages/digbang/fonts)[ RSS](/packages/digbang-fonts/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (5)Dependencies (1)Versions (8)Used By (0)

Digbang/Fonts
=============

[](#digbangfonts)

Helper class to create Font icons with a predefined markup.

Installation
------------

[](#installation)

Download through composer:

```
composer require digbang/fonts

```

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

```
'providers' => [
    // ...
    Digbang\Fonts\FontsServiceProvider::class,

],

'aliases' => [
    // ...
    'Fonts' => Digbang\Fonts\Facade::class,
],
```

Publish the config file:

```
php artisan vendor:publish --provider Digbang\\Fonts\\FontsServiceProvider

```

Usage
-----

[](#usage)

### Through the facade

[](#through-the-facade)

```
// The `icon` function will use the configured icon prefix (defaults to "fa")
Fonts::icon('icon', 'extra-class') //
```

Package provides "fa" and "mat" as helper method for [Font Awesome](http://fontawesome.io/) and [Material Design](http://zavoloklom.github.io/material-design-iconic-font/icons.html) icons.

```
Fonts::fa()->icon('icon', ['class' => 'extra-class']) //
Fonts::mat()->icon('icon', ['class' => 'extra-class']) //
```

### Through the helper function

[](#through-the-helper-function)

```
icon('foo'); //
fa('icon', 'extra-class') //
mat('icon', ['class' => 'extra-class']) //
```

### HTML Attributes

[](#html-attributes)

You can also add any other attributes to the html.

```
fa('times', ['title' => 'Delete this!']) //
```

### Inner content

[](#inner-content)

An icon can have inner content:

```
fa('times', 'text-hide')->withContent("Remove element");

// FontAwesome stacks
fa('stack', 'fa-lg')->withContent(
    fa('circle', 'fa-stack-2x') .
    fa('flag', 'fa-stack-1x fa-inverse')
);
```

### Changing the tag

[](#changing-the-tag)

You can change the tag used by the library.

```
// Setting a new default tag to all fonts
Fonts::setDefaultTag('span');
fa('edit'); //

// Setting a tag on each use
Fonts::fa()->withTag('span')->icon('times'); //
```

### Extending the factory

[](#extending-the-factory)

The `Digbang\Fonts\FontManager` can be extended with macros:

```
Fonts::macro('digbang', function () {
    return $this->create('db');
});

Fonts::digbang()->icon('foo'); //
```

### Standalone usage

[](#standalone-usage)

Non-Laravel projects can still use this, but the Facade and helper function won't be available.

```
$fonts = new Digbang\Fonts\Factory('fa');
$fonts->setDefaultTag('span');

$fonts->icon('times', 'text-danger'); //
$fonts->mat()->icon('times', 'text-danger'); //
```

###  Health Score

38

—

LowBetter than 85% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity27

Limited adoption so far

Community21

Small or concentrated contributor base

Maturity73

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~299 days

Recently: every ~220 days

Total

7

Last Release

1545d ago

Major Versions

v0.4.0 → v1.0.02022-02-23

PHP version history (4 changes)0.1.1PHP &gt;=7.0.0

v0.3.0PHP ^7.3

v0.4.0PHP ^7.3|^8.0

v1.0.0PHP ^7.4 || ^8.0.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/815bc7d874ad7abe1cbc64eb03ac8931f16f9a5f0795d6d73399d0d7003afb5f?d=identicon)[demiansc](/maintainers/demiansc)

![](https://www.gravatar.com/avatar/b0dfa821a53e1e0912cdd57436ce11ee812a2597a9ffbd60c47a3af47e948aac?d=identicon)[dpgover](/maintainers/dpgover)

![](https://www.gravatar.com/avatar/1cc6c8bdb5c60e8da7e28d288d415a4c1bc520c9fde83aa42110e260c9002cdc?d=identicon)[marianofilipoff](/maintainers/marianofilipoff)

---

Top Contributors

[![guiwoda](https://avatars.githubusercontent.com/u/1625545?v=4)](https://github.com/guiwoda "guiwoda (8 commits)")[![dpgover](https://avatars.githubusercontent.com/u/5347955?v=4)](https://github.com/dpgover "dpgover (4 commits)")[![sojeda](https://avatars.githubusercontent.com/u/17851841?v=4)](https://github.com/sojeda "sojeda (4 commits)")[![marianofilipoff](https://avatars.githubusercontent.com/u/17851999?v=4)](https://github.com/marianofilipoff "marianofilipoff (2 commits)")[![riedelalejandro](https://avatars.githubusercontent.com/u/11334068?v=4)](https://github.com/riedelalejandro "riedelalejandro (1 commits)")

### Embed Badge

![Health badge](/badges/digbang-fonts/health.svg)

```
[![Health](https://phpackages.com/badges/digbang-fonts/health.svg)](https://phpackages.com/packages/digbang-fonts)
```

###  Alternatives

[barryvdh/laravel-ide-helper

Laravel IDE Helper, generates correct PHPDocs for all Facade classes, to improve auto-completion.

14.9k123.0M687](/packages/barryvdh-laravel-ide-helper)[orchestra/canvas

Code Generators for Laravel Applications and Packages

20917.2M158](/packages/orchestra-canvas)[illuminate/pipeline

The Illuminate Pipeline package.

9346.6M213](/packages/illuminate-pipeline)[illuminate/pagination

The Illuminate Pagination package.

10532.5M862](/packages/illuminate-pagination)[spatie/laravel-pjax

A pjax middleware for Laravel 5

513371.8k11](/packages/spatie-laravel-pjax)[spatie/laravel-mix-preload

Add preload and prefetch links based your Mix manifest

169176.0k2](/packages/spatie-laravel-mix-preload)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
