public function actionDeleteImage(): Response
    {
        $model = $this->findModel($this->attachmentModelClass, Yii::$app->request->post('id'));

        $model->delete();

        return $this->asJson([
            'status' => 'success',
        ]);
    }
public function actionDeleteImage(): Response
    {
        $model = $this->findModel($this->attachmentModelClass, Yii::$app->request->post('id'));

        $model->delete();

        return $this->asJson([
            'status' => 'success',
        ]);
    }
public function actionDeleteImage ( ) : Response { $ model = $ this -> findModel ( $ this -> attachmentModelClass , Yii :: $ app -> request -> post ( 'id' ) ) ; $ model -> delete ( ) ; return $ this -> asJson ( [ 'status' => 'success' , ] ) ; }
Delete the image

@return Response

@throws UnprocessableEntityHttpException
Delete the image