Downloads
Stars
Version
A Laravel Nova 4 Field for Font Awesome 6 Icons
You can install the package in to a Laravel app that uses Nova via composer:
composer require marshmallow/nova-fontawesome
Then copy FontAwesome v6 css assets to Laravel public path where this plugin will try to access:
/public/css/fontawesome.css
Add the below to app/Nova resources.
use Marshmallow\NovaFontAwesome\NovaFontAwesome;
NovaFontAwesome::make('Icon')
Add fontawesome.css to the public/css
You can override the text for the field button like so
NovaFontAwesome::make('Icon')->addButtonText('Click Me!')
You can set a default icon for when an icon has not been set like so. First parameter is the type e.g. far, fas, fab and the second is the icon name (without fa-)
NovaFontAwesome::make('Icon')->defaultIcon('far', 'check-circle')
If you want to persist the default icon (when they press clear it brings back the default so it can't be empty) then add the following:
NovaFontAwesome::make('Icon')->addButtonText('Click Me!')->defaultIcon('far', 'check-circle')->persistDefaultIcon()
You can limit the icons the user can choose from like so
NovaFontAwesome::make('Icon')->only([
'facebook',
'twitch',
'twitter',
])
You can use Font Awesome Pro by doing the following (remember to get your license key!)
NovaFontAwesome::make('Icon')->pro()
FONTAWESOME_NPM_AUTH_TOKEN=YOUR_TOKEN npm install
Free:
Pro:
Based on Fontawesome Package by mdixon18 & PR from duckzland. See https://github.com/mdixon18/fontawesome
The MIT License (MIT). Please see License File for more information.