I want to set a default value for a hidden form field in laravel 8.
$form->hidden("product.product_type")->value('1')->setDisplay(false);
Here after saving the form, the value is set as null and not 1. What could be the solution?
value('1')->setDisplay(false); Here after s" /> value('1')->setDisplay(false); Here after s" /> value('1')->setDisplay(false); Here after s"/>
I want to set a default value for a hidden form field in laravel 8.
$form->hidden("product.product_type")->value('1')->setDisplay(false);
Here after saving the form, the value is set as null and not 1. What could be the solution?
Copyright © 2021 Jogjafile Inc.
you have to chain default function
as per documentation here
https://laravel-admin.org/docs/en/model-form-fields#Set%20default%20value