Hello below is my code for the updating record in yii rest api i have only column name in db
I am running in the postman with both request put and patch
but my controll goes to last else
plz help
public function actionNewOne($id){
$model = Standard::find()->where(['id' => $id])->one();
//print_r($model);die();
if ($model->load(Yii::$app->request->post()) && $model->validate()) {
if ($model->save()) {
return array('status' => true, 'message' => 'Standard Updated');
} else {
return array('status' => false, 'message' => 'Something went wrong');
}
} else {
return array('status' => false, 'message' => 'Something went wrong in validation or request');
}
}