Browse Source

Merge pull request #544 from zhenxxin/bugfix/update-relation

修复模型中存在 hasMany 关联属性时保存数据会报 “Undefined index: _remove_” 错误的问题
Jiang Qinghua 4 years ago
parent
commit
01a0a645fe
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/Repositories/EloquentRepository.php

+ 1 - 1
src/Repositories/EloquentRepository.php

@@ -778,7 +778,7 @@ class EloquentRepository extends Repository implements TreeRepository
 
                         $instance = $relation->findOrNew(Arr::get($related, $keyName));
 
-                        if ($related[Form::REMOVE_FLAG_NAME] == 1) {
+                        if (Arr::get($related, Form::REMOVE_FLAG_NAME) == 1) {
                             $instance->delete();
 
                             continue;