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

robbiel's avatar

How to have a text nova field readonly and with a default value fetched from DB

I have this Laravel nova code where there is a readonly field. But this field should be populated with a value that already exists on a database table.

Do you know how to use Eloquent inside the Text nova field to get that database value?

    new Panel('Settings', [
                    ...JSON::make('Settings', [
                        Text::make('Site Locale', 'siteLocale')->readonly(),
                    ])->data
                ]),
0 likes
0 replies

Please or to participate in this conversation.