Skip to content

Instantly share code, notes, and snippets.

@HelgeSverre
Created March 9, 2025 05:11
Show Gist options
  • Save HelgeSverre/a557181387ed10b061b0b17adf55ada9 to your computer and use it in GitHub Desktop.
Save HelgeSverre/a557181387ed10b061b0b17adf55ada9 to your computer and use it in GitHub Desktop.
<!--
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