Download the PHP package bernhardh/nova-icon-select without Composer
On this page you can find all versions of the php package bernhardh/nova-icon-select. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package nova-icon-select
Nova Icon Select
This is a laravel nova field to select an icon from an icon set. The icon sets are defined by an IconProvider
, so you can define your own set. The package has a predefined IconProvider
for FontAwesome 5 Free
.
Screenshots
Edit
Index
Details
Installation
Install this package with composer
You need to include the styles of the icon set to nova by your own. A common way to do this is to add it to your resources/views/vendor/nova/partials/meta.blade.php
.
For FontAwesome
you can do this like this:
Of course, you can also host the icon-set on your server or even use completly different icons.
Usage
Like every other field, you can use the field inside your Nova Resource. You will need to provide an IconProvider
. Either use the build in FontAwesomeIconProvider
or use an instance of IconProvider
or create your own.
Using with FontAwesome 5 Free
For FontAwesome 5 Free
, there is already a build in Provider. Use it like this:
If you want to change the labels, remove icons or add search tags, you can publish the config:
and now you can modify the config/nova-icon-select/fontawesome.php
file as you like.
Using with your own icon sets
To use your own icon set, you can either create your own IconProvider
class and extend it from Bernhardh\NovaIconSelect\IconProvider
or you can use Bernhardh\NovaIconSelect\IconProvider
as an instance and add your options directly.
Use instance and setOptions
Or you can of course also move the options to a config file and get it with config()
Use your own class
Now you can use it
Options
Example:
Each option consist of these fields:
label
: Required string. This is the value which will be shown in nova and this value is used in the search (checks if label contains search string)value
: Required string. This is the actual icon class or identifier which will be stored to the database. In case ofFontAwesome
, this would be something likefas fa-edit
search:
: Optional string array. This array is used in the search (checks if one of the strings start with the search string)unicode
: Optional string. Currently not used
Of course you can move the options to a config file as I did with the FontAwesomeIconProvider
Changelog
Please see CHANGELOG for more information what has changed recently.