How to set a Laravel Nova field to display as readonly or protected?
This capability was added in v1.1.4 (October 1, 2018).
- Allow setting any attribute on text and textarea fields
Example usage:
Text:: make('SomethingImportant')
->withMeta(['extraAttributes' => [
'readonly' => true
]]),
As of v2.0.1, readonly() is native and accepts a callback, closure or boolean and can simply be called as:
Text::make('Name')->readonly(true)
This may have been added prior to this version but the changelog does not specify if this is the case.
Nova v2.0 documentation