PHP code example of g4b0rdev / filament-solar-icons
1. Go to this page and download the library: Download g4b0rdev/filament-solar-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/ */
g4b0rdev / filament-solar-icons example snippets
use G4b0rDev\Icons\Solar\SolarIcons;
public function panel(Panel $panel): Panel
{
return $panel
->plugin(SolarIcons::make());
}
SolarIcons::make()
->style('bold');
declare(strict_types=1);
use Filament\Support\Contracts\HasColor;
use Filament\Support\Contracts\HasIcon;
use G4b0rDev\Icons\Solar\Enums\SolarLineDuotone;
enum Status: string implements HasColor, HasIcon
{
case DRAFT = 'draft';
case PUBLISHED = 'published';
case ARCHIVED = 'archived';
public function getIcon(): string
{
return match ($this) {
self::DRAFT => SolarLineDuotone::Pen->getIconName(),
self::PUBLISHED => SolarLineDuotone::CheckRead->getIconName(),
self::ARCHIVED => SolarLineDuotone::Box->getIconName(),
};
}
public function getColor(): string
{
return match ($this) {
self::DRAFT => 'secondary',
self::PUBLISHED => 'success',
self::ARCHIVED => 'danger',
};
}
}
use Filament\Tables\Columns\TextColumn;
use G4b0rDev\Icons\Solar\Enums\SolarBold;
TextColumn::make('status')
->badge()
->icon(fn (string $state): string => match ($state) {
'active' => SolarBold::CheckCircle->getIconName(),
'inactive' => SolarBold::CloseCircle->getIconName(),
'pending' => SolarBold::ClockCircle->getIconName(),
default => SolarBold::QuestionCircle->getIconName(),
})
use Filament\Forms\Components\TextInput;
use G4b0rDev\Icons\Solar\Enums\SolarOutline;
TextInput::make('email')
->email()
->prefixIcon(SolarOutline::Letter->getIconName())
enum Priority: string implements HasIcon
{
case HIGH = 'high';
case MEDIUM = 'medium';
case LOW = 'low';
public function getIcon(): string
{
return match ($this) {
self::HIGH => SolarBold::DangerTriangle->getIconName(),
self::MEDIUM => SolarOutline::InfoCircle->getIconName(),
self::LOW => SolarLinear::CheckCircle->getIconName(),
};
}
}