yii2 required field only on create action not working using scenario method

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';

What do the fields look like in your view?

What does the browser post when you submit? You can see that either in your browser’s development tools or with a program like Fiddler.