PHP code example of bugo / moonshine-heroicons-field
1. Go to this page and download the library: Download bugo/moonshine-heroicons-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/ */
bugo / moonshine-heroicons-field example snippets
/*
* Possible values:
* 's', 'solid' - Solid 24x24, Solid fill
* 'o', 'outline' - Outline 24x24, 1.5px stroke
* 'm', 'mini' - Mini 20x20, Solid fill
* 'c', 'micro' - Micro 16x16, Solid fill
*/
return [
'style' => env('HEROICONS_STYLE', 'solid'),
];
declare(strict_types=1);
namespace App\MoonShine\Resources;
use Bugo\MoonShine\Heroicons\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()
->useStyle('mini'),
];
}
}