Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Kris01's avatar

Laravel Nova

Hello guys,

I'm implementing laravel nova as admin panel. How can I display json fields humanly? I have something like this in the db

{["Name": "this is the name", "content": "this is the contet"],["Name": "this is the name 2", "content": "this is the contet 2"]}
0 likes
3 replies
Kris01's avatar

@wingly I don't know why it's taking letter by letter. something like this.

1    [
2  {
3  "
4  N
5  A
5  M
6  E

and so on

ramonrietdijk's avatar

@Kris01 This is happening because Laravel Nova treats your JSON as a string instead of an array. You can add a cast to your model to display it correctly.

protected $casts = [
    'options' => 'array',
];

Please or to participate in this conversation.