// DOKUMENTATION ICON PICKER 2.x
Veraltet

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

Zur Dokumentation für 4.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 709K Installationen · 163 Sterne
// COOKIES

Ein paar Cookies halten die Seite am Laufen; andere merken sich Einstellungen oder zählen Besuche. Sie entscheiden.

Cookie-Richtlinie