// DOKUMENTATION ICON PICKER 2.x
Veraltet

Sie lesen die Dokumentation für 2.x. Aktuell ist 5.x.

Zur Dokumentation für 5.x →

Usage

In a resource

use Guava\FilamentIconPicker\Forms\IconPicker;

public static function form(Form $form): Form
{
    return $form->schema([
        IconPicker::make('icon'),
    ]);
}

In a livewire component

use Filament\Forms\Form;
use Guava\FilamentIconPicker\Forms\IconPicker;

public function form(Form $form): Form
{
    return $form
        ->schema([
            IconPicker::make('icon'),
        ])
        ->statePath('data')
    ;
}

In tables

// Make sure this is the correct import, not the filament one
use Guava\FilamentIconPicker\Tables\IconColumn;

public static function table(Table $table): Table
{
    return $table
        ->columns([
            IconColumn::make('icon'),
        ])
        // ...
    ;
}

On the frontend

The state of the field is the identifier of the selected icon, so there is nothing package specific about rendering it.

Assuming you saved the icon on your $category model under icon:

<x-icon name="{{ $category->icon }}" />

More information on rendering icons is in the blade-icons documentation.

guava/filament-icon-picker 844K Installationen · 165 Sterne
// COOKIES

Ein paar Cookies halten die Seite am Laufen und merken sich die Sprache, in der Sie lesen. Andere zählen Besuche, und die bleiben aus, bis Sie zustimmen.

Cookie-Richtlinie