1. Go to this page and download the library: Download filafly/filament-icons 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/ */
filafly / filament-icons example snippets
namespace App\Enums;
enum MyIcon: string
{
case SearchRegular = 'search';
case SearchSolid = 'search-solid';
// ... other icons
}
namespace App\Enums;
use Filafly\Icons\Contracts\StyleEnum as StyleEnumContract;
enum MyIconStyle: string implements StyleEnumContract
{
case Regular = 'regular';
case Solid = 'solid';
public function getStyleName(): string
{
return $this->value;
}
public function getEnumSuffix(): string
{
return ucfirst($this->value);
}
public static function getStyleNames(): array
{
return array_column(self::cases(), 'value');
}
public static function fromStyleName(string $styleName): ?self
{
foreach (self::cases() as $case) {
if ($case->getStyleName() === $styleName) {
return $case;
}
}
return null;
}
}
namespace App\Icons;
use App\Enums\MyIcon;
use App\Enums\MyIconStyle;
use Filafly\Icons\IconSet;
class MyIcon extends IconSet
{
protected string $pluginId = 'vendor-filament-my-icons';
protected string $iconPrefix = 'my-icon'; // Optional: if different from guessed prefix
protected mixed $iconEnum = MyIcon::class;
protected ?string $styleEnum = MyIconStyle::class; // Optional
}