Search by

bugo / moonshine-fontawesome-field

Bugo

Font Awesome icons selection field for MoonShine

Package info

github.com/dragomano/moonshine-fontawesome-field

pkg:composer/bugo/moonshine-fontawesome-field

Statistics

Installs: 508

Dependents: 0

Suggesters: 0

Stars: 2

Open Issues: 0

3.0 2026-11-13 06:05 UTC

This package is auto-updated.

Last update: 2026-11-13 06:10:34 UTC


README

PHP Coverage Status

Convenient Font Awesome icons selection field for MoonShine

Support MoonShine versions

MoonShine This package
2.0+ 0.x
3.0+ 1.x
4.0+ 2.x
5.0+ 3.x

Requirements

MoonShine 5 requires PHP 8.4+ and Laravel 11, 12 or 13.

This package additionally requires Laravel 12 or 13: owenvoke/blade-fontawesome depends on illuminate/support ^12.0|^13.0, so Laravel 11 is not supported.

Installation

composer require bugo/moonshine-fontawesome-field

Usage

You can use IconSelect field in your resources:

<?php

declare(strict_types=1);

namespace App\MoonShine\Resources;

use Bugo\MoonShine\FontAwesome\Fields\IconSelect;
use MoonShine\Laravel\Resources\ModelResource;
use MoonShine\Contracts\UI\FieldContract;
use MoonShine\Contracts\UI\ComponentContract;

/**
 * @extends ModelResource<Custom>
 */
class CustomResource extends ModelResource
{
    /**
     * @return list<ComponentContract|FieldContract>
     */
    protected function formFields(): iterable
    {
        return [
            IconSelect::make('Icon')
                ->searchable(),
        ];
    }
}

All use cases of Blade Font Awesome are also available for you.

Escaping

Since MoonShine 5 labels, hints and prefixes are escaped by default. If you need raw HTML in them, disable escaping for the specific element:

IconSelect::make('<strong>Icon</strong>')
    ->unescapeLabel();

Caching

When using icons in Blade templates, be sure to enable Caching.

How to update icon sets

Once the package is installed, run these commands:

pnpm add @fortawesome/fontawesome-free -D
php artisan moonshine:update-fa-icons

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.