File tree Expand file tree Collapse file tree 1 file changed +2
-1
lines changed
src/resources/views/crud/fields Expand file tree Collapse file tree 1 file changed +2
-1
lines changed Original file line number Diff line number Diff line change 44 $field [' onLabel' ] = $field [' onLabel' ] ?? ' ' ;
55 $field [' offLabel' ] = $field [' offLabel' ] ?? ' ' ;
66 $field [' color' ] = $field [' color' ] ?? ' var(--bg-switch-checked-color, black)' ;
7+ $switchClass = (str_starts_with ($field [' color' ], ' var(' ) || str_starts_with ($field [' color' ], ' #' )) ? ' ' : ' switch-' . $field [' color' ];
78@endphp
89
910{{-- Wrapper --}}
1415
1516 <div class =" d-inline-flex align-items-center" >
1617 {{-- Switch --}}
17- <label class =" form-switch switch switch-sm switch-label switch-pill mb-0" @if ($field [' color' ] !== ' var(--bg-switch-checked-color, black)' ) style =" --bg-switch-checked-color : {{ $field[' color' ] }};" @endif >
18+ <label class =" form-switch switch switch-sm switch-label switch-pill mb-0 {{ $switchClass } } " @if ($field [' color' ] !== ' var(--bg-switch-checked-color, black)' ) style =" --bg-switch-checked-color : {{ $field[' color' ] }};" @endif >
1819 <input
1920 type =" hidden"
2021 name =" {{ $field [' name' ] } }"
You can’t perform that action at this time.
0 commit comments