Created
March 9, 2025 05:11
-
-
Save HelgeSverre/a557181387ed10b061b0b17adf55ada9 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- | |
Use like this | |
TextEntry::make('data') | |
->label('Data') | |
->view('filament.infolists.json-view') | |
->columnSpanFull(), | |
--> | |
<x-dynamic-component component="filament-infolists::entry-wrapper"> | |
<div | |
{{ | |
$attributes | |
->merge($getExtraAttributes(), escape: false) | |
->class([ | |
'fi-in-text', | |
]) | |
}} | |
> | |
@php | |
$json = is_array($getState()) | |
? json_encode($getState(), JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE) | |
: $getState(); | |
@endphp | |
<x-code | |
class="!bg-gray-50 !text-base" | |
style="white-space: pre-wrap" | |
:text="$json" | |
/> | |
</div> | |
</x-dynamic-component> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment