// DOKUMENTACE ICON PICKER 1.x
Neaktuální

Čtete dokumentaci k verzi 1.x. Aktuální je 4.x.

Přejít na dokumentaci 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 Guava\FilamentIconPicker\Forms\IconPicker;

protected function getFormSchema(): array
{
    return [
        IconPicker::make('icon'),
    ];
}

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 instalací · 163 hvězd
// COOKIES

Pár cookies drží web v chodu; další si pamatují nastavení nebo počítají návštěvy. Vy rozhodujete, co poběží.

Zásady cookies