I want two fields to be required on create but not when updating, I have researched and found that using Yii2 scenarios is the kind of thing I need to do. However when I set the two fields to required within my model and then click submit within my form the validation does work and tells me to fill in the fields however when i fill the field in and click submit the form doesn’t submit properly and them two particular fields get emptied and it tells me they are empty even though initially id filled them in.
Model Setup
[['featured_image', 'gallery'],'required', 'on' => 'create']
Controller Create Action Setup
$model = new Posts();
$model->scenario = 'create';