标签: laravel
如果当前模型在保存时失败,我需要删除另一个模型。
尝试:
$saved = $model->save(); // if validation fails the application has aborted // never executes this if ( !$saved ) { $anotherModel->delete(); }
怎么做?