PHP code example of fawaziwalewa / filament-icon-picker

1. Go to this page and download the library: Download fawaziwalewa/filament-icon-picker 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/ */

    

fawaziwalewa / filament-icon-picker example snippets


use FawazIwalewa\FilamentIconPicker\Forms\Components\IconPicker;

IconPicker::make('icon')
    ->label('Icon')
    ->

IconPicker::make('icon')
    ->sets(['heroicons', 'lucide', 'bootstrap']);

IconPicker::make('icon')
    ->gridColumns(8)
    ->searchable(true)
    ->placeholder('Pick an icon');

use Filament\Tables\Columns\TextColumn;

TextColumn::make('name')
    ->icon(fn ($record) => $record->icon);

use FawazIwalewa\FilamentIconPicker\Services\IconService;
use Illuminate\Database\Eloquent\Casts\Attribute;

protected function icon(): Attribute
{
    return Attribute::make(
        get: fn (?string $value): ?string => IconService::normalizeIconName($value),
        set: fn (?string $value): ?string => IconService::normalizeIconName($value),
    );
}
bash
php artisan vendor:publish --tag="filament-icon-picker-config"
bash
php artisan vendor:publish --tag="filament-icon-picker-views"
bash
php artisan filament-icon-picker:list
bash
php artisan filament-icon-picker:list --set=heroicons
bash
php artisan filament-icon-picker:list --search=user
bash
php artisan test