Monday, 26 June 2023

Laravel Nova ReadOnly Problems

 On Laravel Nova,   when creating record field with readonly and default values are not submitted.  This is the correct way to work around it.


Text::make("Field Name", 'field_name')
->withMeta(
[
'extraAttributes' => ['readonly' => true],
'value' => $this->field_name ?? 'Default Value'
]), 
Share:

Popular Posts

Recent Posts

Pages

Powered by Blogger.

About Me

My photo
For the past 10 years, I've been playing with codes using PHP, Java, Rails. I do this for a living and love new things to learn and the challenges that comes with it. Besides programming I love spending time with friends and family and can often be found together catching the latest movie or planning a trip to someplace I've never been before.