Level 5
You can either use https://nova.laravel.com/docs/3.0/resources/fields.html#showing-hiding-fields to hide the column on create and edit, or marked it as readonly https://nova.laravel.com/docs/3.0/resources/fields.html#readonly-fields
1 like
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
how can i display but not modify some fields such as the api_token field in User ?
I have the User resource like this:
public function fields(Request $request)
{
return [
ID::make()->sortable(),
Gravatar::make()->maxWidth(50),
Text::make('Name')
->sortable()
->rules('required', 'max:255'),
Text::make('Email')
->sortable()
->rules('required', 'email', 'max:254')
->creationRules('unique:users,email')
->updateRules('unique:users,email,{{resourceId}}'),
Password::make('Password')
->onlyOnForms()
->creationRules('required', 'string', 'min:8')
->updateRules('nullable', 'string', 'min:8'),
Text::make('Api_token'),
BelongsToMany::make('Languages'),
];
}
I would like the Api Token field not to be editable, how could I do?
Please or to participate in this conversation.