filamentphp / filament

A collection of beautiful full-stack components for Laravel. The perfect starting point for your next app. Using Livewire, Alpine.js and Tailwind CSS.
https://filamentphp.com
MIT License
17.42k stars 2.73k forks source link

Trying to use an icon pack that's not Heroicons, but is listed on Blade UI Kit. #376

Closed AlexHaible closed 3 years ago

AlexHaible commented 3 years ago

Describe the bug Filament doesn't seem to recognize additional icon packs installed, despite the pack being supported by Blade Icons, which from what I could see is what handles Heroicons as well.

To reproduce

  1. Install davidhsianturi/blade-bootstrap-icons
  2. Attempt to use icons, like so: Columns\Icon::make('status')->options([ '0' => 'bi-phone-landscape', '1' => 'bi-phone', '2' => 'bi-square', ]),

Expected behavior Expected icons to be showed depending on value from database.

Code Error Call to undefined function bi-phone-landscape() (View: /Users/user/Laravel/project/vendor/filament/filament/packages/tables/resources/views/cells/icon.blade.php)

Context

ryangjchandler commented 3 years ago

@AlexHaible The issue here is the syntax you're using inside of options(). You'll want to do something like this:

Columns\Icon::make('status')
    ->options([
        'bi-phone-landscape' => fn ($status) => $status == '0'
    ])

The documentation for the column is actually incorrect. I'll open an issue on the documentation repo and we'll get this sorted.

AlexHaible commented 3 years ago

That'd explain why it didn't work as I copied it straight from the documentation. Well, glad I could help find that issue.

danharrin commented 3 years ago

This has now been fixed in the docs 👍