lukas-frey / filament-icon-picker

An icon picker field for Filament
MIT License
106 stars 20 forks source link

How do i deal with null icons #29

Closed jcc5018 closed 8 months ago

jcc5018 commented 8 months ago

I am using your filament package as some of my models need icons but not all. But when adding the IconColumn::make('icon'), to my table, i end up with an error Svg by name "" from set "heroicons" not found. I'm assuming because most records dont have an icon defined.

I am not even using heroicons, so how do I handle null values in my tables?

Thanks

lukas-frey commented 8 months ago

Hi! Thanks for the info, it's fixed in v2.0.4. :)

jcc5018 commented 8 months ago

Thanks, that is preventing the error on the icon page, however, i am still having trouble as I am using font awesome icons yet i get this message

Svg by name "fas-user-friends" from set "heroicons" not found. They do not display in blade either

{
    return $table
        ->columns([
            TextColumn::make('id')
                      ->numeric()
                      ->sortable(),
            TextColumn::make('tag'),
            IconColumn::make('icon'),

      //      and in the form:

                  IconPicker::make('icon')
                      ->sets(['fontawesome-solid']),
            ```

            and i have tried uncommenting every option in the config file:   so Im not sure how else to get it to search font awesome instead of heroicons

             'sets'    => null,
//     example:
//    'sets'    => 'fontawesome-solid',
//        'sets'    => [
//            'heroicons',
//            'fontawesome-solid',
//        ],
lukas-frey commented 8 months ago

If you added the icon set after already using the plugin, you need to clear the cache.