feat: add fallback icon for non-existent icons in the ChooseUsTable icon column
This commit is contained in:
parent
729d43d7e5
commit
c021bcccf9
@ -25,7 +25,11 @@ public function columns(): array
|
||||
|
||||
Column::make('Icon', 'icon')
|
||||
->format(function ($value) {
|
||||
return Blade::render('<flux:icon.'.$value.'/>');
|
||||
$icon = 'flux.icon.'.$value;
|
||||
|
||||
return view()->exists($icon)
|
||||
? Blade::render('<flux:icon.'.$value.'/>')
|
||||
: Blade::render('<flux:icon.question-mark-circle/>');
|
||||
})
|
||||
->html()
|
||||
->searchable()
|
||||
|
||||
Loading…
Reference in New Issue
Block a user