Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Nova Fa Icon Laravel Package

welkervinicius/nova-fa-icon

Laravel Nova package that adds Font Awesome icon support, providing a field/component for selecting and displaying Font Awesome icons in Nova resources and forms for simple admin panel integration.

View on GitHub
Deep Wiki
Context7

Getting Started

  • Install into a Laravel 10/11/12 app running Nova 5:
    composer require <vendor>/nova-fa-icon:^1.1
    
  • Publish any package assets/config so Nova can serve them (typical Nova tool/field packages need this):
    php artisan vendor:publish --tag=nova-fa-icon-config
    php artisan vendor:publish --tag=nova-fa-icon-lang
    php artisan nova:publish
    
  • Look first at config/nova-fa-icon.php (icon set / default set) and resources/lang/ (now includes en, pt_BR, es, it, ru). The README is the fastest reference for the field namespace and registration.
  • First use case: add a Font Awesome icon picker to a Nova resource form. Drop the field into fields():
    use Vendor\NovaFaIcon\NovaFaIcon;
    
    public function fields(NovaRequest $request)
    {
        return [
            NovaFaIcon::make('Icon', 'icon')
                ->rules('required', 'string', 'max:255'),
        ];
    }
    
    The field stores the selected icon class (e.g. fa-solid fa-star) as a plain string column, so it works with Text/String migrations out of the box.

Implementation Patterns

  • Resource form field. The primary workflow — a searchable Font Awesome selector bound to a string attribute. Pair with ->help() and validation to keep stored values predictable.
  • Index/detail display. Render the stored class in a card or custom component: <i class="{{ $resource->icon }}"></i>. Keep the class string as the single source of truth rather than storing an enum.
  • Config-driven icon sets. Centralize which Font Awesome version/style is exposed in the package config, then reference it from both the field and any front-end rendering helper so the picker and output never drift.
  • Namespaced translations (v1.1.0+). All package strings resolve via __('nova-fa-icon::messages.key'). To brand or reword, publish the lang files and override under lang/vendor/nova-fa-icon/{locale}/messages.php rather than editing vendor code.
  • Multi-language apps. The new pt_BR, es, it, ru catalogs mean the picker UI labels localize automatically based on app()->getLocale(). For locales not shipped, copy en/messages.php into your overrides and translate the keys — no code changes needed.
  • Custom tools/cards. When embedding the picker inside a Nova tool, use the same namespaced __() calls in your Vue labels so translations stay consistent with the field.
  • Locale switching in tests. Assert localized labels with $this->withSession(['locale' => 'es']) or App::setLocale('es') before rendering the form, verifying the new catalogs load.

Gotchas and Tips

  • Upgrade to ≥1.1.0 if you saw raw keys. On Laravel 10, keys like nova-fa-icon::messages.key previously rendered as literal text. v1.1.0 switches to PHP-based namespaced translations, the stable approach across Laravel 10/11/12. If you pinned 1.0.x, that bug is your symptom.
  • Clear caches after upgrading. Translation loading is cached aggressively: run php artisan optimize:clear (and config:clear, view:clear) — otherwise the old broken loading path can persist.
  • Namespace must be registered. If you override translations and they don't take effect, confirm the override sits at lang/vendor/nova-fa-icon/{locale}/messages.php and that the package service provider's loadTranslationsFrom() namespace (nova-fa-icon) matches. A stray space or wrong folder name silently falls back to English.
  • Locale fallback masks gaps. Missing keys fall back to the fallback locale, so a half-translated it catalog won't error — it will show English. Verify with __('nova-fa-icon::messages.key') directly in tinker under the target locale.
  • Nova asset publishing. Vue/JS changes only appear after php artisan nova:publish. A "picker shows old labels" report is almost always a stale published asset, not a translation bug.
  • Version pinning. Nova 5 + Laravel 10/11/12 is the supported matrix for 1.1.0. Pin ^1.1 and run your Nova test suite after upgrading; older Nova versions are untested.
  • Extension point for new languages. Adding a locale is data-only — drop a messages.php into the vendor lang path. Keep keys identical to en so future releases don't break your overrides.
  • Don't store labels. The field should persist the icon class, not the translated label — otherwise locale changes corrupt stored data.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
novasa/laravel-language-center
opencage/geocode
adolfoholzer/parameters
livenetworks/ln-starter
shitoudev/permissionmanager
johannesclimacus/laravel-tui
hocvt/seotools
vitalybaev/sypexgeo
amphibee/themosis-ignition
gito-me/fast-excel
frankyso/laravel-ipaymu
geolize-studio/laravel-chile
boomerangui/chat
cgv/localized-resource
noith/settings
kda/laravel-package
kda/filament-dynamic-navigation
bypersoft/signbox
pairus/product-data
fayne/laravel-filament-cms-core