PHP code example of datomatic / nova-icon-field

1. Go to this page and download the library: Download datomatic/nova-icon-field library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

datomatic / nova-icon-field example snippets


    'nova-icon-field' => [
        'driver' => 'local',
        'root' => storage_path('icons'),
        'throw' => false,
    ],

  use Datomatic\NovaIconField\NovaIconField;

  NovaIconField::make('Icon')

  NovaIconField::make('Icon')
    ->addButtonText('Click me!')

  NovaIconField::make('Icon')
    ->defaultIcon('solid', 'check-circle')

  NovaIconField::make('Icon')
    ->defaultIcon('solid', 'check-circle')
    ->persistDefaultIcon()

  NovaIconField::make('Icon')->only([
    'solid', // enables all the icons with style `solid` or name `solid`
    
    ['style' => 'solid'], // enable all the icons with style `solid`
    ['icon' => 'arrow-up'], // enable all the icons with name `arrow-up`
    
    'solid arrow-down', // enables the icon with style `solid` and name `arrow-down`
    ['style' => 'solid', 'icon' => 'arrow-down'], // enables the icon with style `solid` and name `arrow-down`
  ])

// config/nova-icon-field.php
return [
    // ...
    'style_prefix' => 'fa-',
    'icon_prefix' => 'fa-',
    // ...
];

php artisan vendor:publish --provider="Datomatic\NovaIconField\FieldServiceProvider" --tag="translations"

php artisan vendor:publish --provider="Datomatic\NovaIconField\FieldServiceProvider" --tag="config"