CADILAB
CADILAB
FFilament
Created by CADILAB on 5/9/2024 in #❓┊help
passing custom color
So i have something like this: ViewColumn::make('status') ->getStateUsing(function ($record) { $status = ContractStatusEnum::tryFrom($record->status); if ($status) { return [ 'label' => $status->getLabel(), 'color' => Color::hex($status->getColor()), 'icon' => $status->getIcon(), ]; } return [ 'label' => '-', 'color' => null, 'icon' => null, ]; }) ->view('filament.forms.components.contract-status-field'), And custom view: {{ $getState()['label'] }} <x-filament::icon-button icon="{{$getState()['icon']}}" color="{{ $getState()['color'] }}" /> now the issue is, the color is hex, when i convert it and try to use with getState[color] i get the following error htmlspecialchars(): Argument #1 ($string) must be of type string, array given, i've tried unsafe render in laravel but still, am i missing something?
2 replies