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

Narton's avatar

Hide Field if editing

Hi there, is there a way to hide Fields if im in "editing" Mode?

I have a Select which options im getting with

value = integer;
Answer = cleartext;
Select::make(Answer','value')->options(function () {
                return array_filter(\App\Models\Model::where('reference_id', $this->reference_id_foreign)->pluck('answer', 'value)->toArray());
            }),

Which displays me the Value in the "basic" view, if im editing it shows me the answer. I have the cleartext Answer in a seperate Field, but without any relation. is there a way i can hide the "Text" Field if im editing?

0 likes
2 replies
Narton's avatar

I know about the general

->onlyOnIndex();
->hideFromIndex();

it is about the change of visibility if editing ;)

Narton's avatar
Narton
OP
Best Answer
Level 1

ok.. i just discovered it myself

->hideWhenUpdating();

Please or to participate in this conversation.