lukas-frey / filament-icon-picker

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

font awesome icon not displaying in table view #30

Open jcc5018 opened 5 months ago

jcc5018 commented 5 months ago

I have tried adding a simple column to my filament table with the simple

IconColumn::make('icon') as per instructions:

the form is set as:

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

I am using font awesome icons. and selecting such in the form works. however displaying the icons on the table only searches hero icons:

Error: Svg by name "fas-user-friends" from set "heroicons" not found.

Code provided:

@if(strlen($label) > 0)

        <div class="inline-flex items-center gap-1">

    @endif

            <x-svg

                :name="$icon()"

                {{

                    $attributes->class([

                        'inline',

                        'w-5 h-5' => !Str::contains($attributes->get('class'), ['w-', 'h-'])

                    ])

                 }}

            />

        @if(strlen($label) > 0)

                <div class="{{ $labelClasses() }}">

                    {{ $label }}

                </div>

            </div>

        @endif

Specifically highlighting the {{$label}} element

What is missing to make this work properly? Thanks

lukas-frey commented 4 months ago

Hello @jcc5018, sorry for the late reply. Have you been able to fix your issue? I'm unable to reproduce your bug. I created the same Icon Picker as you and I'm able to see the icon in the table view.

jcc5018 commented 4 months ago

no, i still have issues displaying font awesome icons: They show up in the picker but not on the table columns

Icons are in their vendor directory if that makes a difference image

not sure if config files have anything to do with it, but blade-fontawesome config:

`<?php

return [

'brands' => [

    'prefix' => 'fab',

    'fallback' => '',

    'class' => '',

    'attributes' => [
        'width'  => 20,
        'height' => 20,
    ],

],

'regular' => [

    'prefix' => 'far',

    'fallback' => '',

    'class' => '',

    'attributes' => [
        'width'  => 20,
        'height' => 20,
    ],

],

'solid' => [

    'prefix' => 'fas',

    'fallback' => '',

    'class' => '',

    'attributes' => [
        'width'  => 20,
        'height' => 20,
    ],

],

]; `

blade-icons.php

`<?php

return [

'sets' => [

    'default' => [
        //

        'path'       => 'resources/svg',
        //

        //     'disk' => '',

        //
        'prefix'     => 'icon',

        'fallback'   => '',

       'class' => '',

        'attributes' => [
            'width'  => 50,
            'height' => 50,
        ],
        //
    ],

],

'class' => '',

'attributes' => [
    // 'width' => 50,
    // 'height' => 50,
],

'fallback' => '',

'components' => [

    'disabled' => false,

    'default' => 'icon',

],

];`

lukas-frey commented 4 months ago

@jcc5018 Are you using the latest version of the package?

Try clearing the blade icons cache (php artisan icons:clear) and the application cache. (php artisan cache:clear or php artisan optimize:clear)

jcc5018 commented 4 months ago

everything has been updated and cleared... multiple times since the initial post. The icons still do not display on the table. Regardless of which font awesome icon i use:

BladeUI  \  Icons  \  Exceptions  \  SvgNotFound PHP 8.2.13 10.45.1 Svg by name "fas-procedures" from set "heroicons" not found.

lukas-frey commented 4 months ago

I'm sorry, whatever I do, I'm unable to reproduce your issue. If you could provide me with a demo repository where you can reproduce the bug, I can clone it and look into it.

jcc5018 commented 4 months ago

i figured out the issue. Your plugin is not compatible with robsontenorio/mary package, as they both use <x-icon..

I removed the package and the icons display. Not sure if you guys can work together to prevent similar issues.

lukas-frey commented 4 months ago

i figured out the issue. Your plugin is not compatible with robsontenorio/mary package, as they both use <x-icon..

I removed the package and the icons display. Not sure if you guys can work together to prevent similar issues.

Ah, thanks for the headsup! x-icon is not added by my plugin, but by blade icons itself, which is a dependency of this plugin and even of filament.

ashniazi commented 3 weeks ago

i figured out the issue. Your plugin is not compatible with robsontenorio/mary package, as they both use <x-icon.. I removed the package and the icons display. Not sure if you guys can work together to prevent similar issues.

Ah, thanks for the headsup! x-icon is not added by my plugin, but by blade icons itself, which is a dependency of this plugin and even of filament.

Just for visibility - I'm also getting 'Svg by name "icon" from set "default" not found.' on the table view.