File tree Expand file tree Collapse file tree 1 file changed +13
-6
lines changed Expand file tree Collapse file tree 1 file changed +13
-6
lines changed Original file line number Diff line number Diff line change 52
52
53
53
$arrayState = \Illuminate \Support \Arr:: wrap ($arrayState );
54
54
$type = \TomatoPHP \FilamentTypes \Models \Type:: where (' key' , $arrayState [0 ])-> first ();
55
- $arrayState [0 ] = $type -> name ;
55
+ if ($type ){
56
+ $arrayState [0 ] = $type -> name ;
57
+
58
+ $hex = $type -> color ;
59
+ list ($r , $g , $b ) = sscanf ($hex , " #%02x%02x%02x" );
60
+ $colorRGB = array ($r , $g , $b );
61
+ }
62
+ else {
63
+ $arrayState [0 ] = $arrayState [0 ];
64
+ $colorRGB = [0 ,0 ,0 ];
65
+ }
56
66
57
- $hex = $type -> color ;
58
- list ($r , $g , $b ) = sscanf ($hex , " #%02x%02x%02x" );
59
- $colorRGB = array ($r , $g , $b );
60
67
@endphp
61
68
62
69
<div
121
128
@if (filled ($formattedState = $formatState ($state )) &&
122
129
(! ($isListWithLineBreaks && (! $isLimitedListExpandable ) && ($loop -> iteration > $listLimit ))) )
123
130
@php
124
- $color = $type -> color ;
131
+ $color = $type -> color ?? null ;
125
132
$copyableState = $getCopyableState ($state ) ?? $state ;
126
133
$copyMessage = $getCopyMessage ($state );
127
134
$copyMessageDuration = $getCopyMessageDuration ($state );
128
135
$fontFamily = $getFontFamily ($state );
129
- $icon = $type -> icon ;
136
+ $icon = $type -> icon ?? null ;
130
137
$iconColor = $getIconColor ($state ) ?? $color ;
131
138
$itemIsCopyable = $isCopyable ($state );
132
139
$lineClamp = $getLineClamp ($state );
You can’t perform that action at this time.
0 commit comments