@@ 72-75 (lines=4) @@ | ||
69 | } |
|
70 | ||
71 | // Could swap this out for model -> getAttribute, then check if we have an attribute or a relation... getRelationValue() is helpful |
|
72 | if (method_exists($this->model, $key) && is_a(call_user_func_array([$this->model, $key], []), 'Illuminate\Database\Eloquent\Relations\Relation')) { |
|
73 | $this->saveRelation('doSave', $key, $value); |
|
74 | continue; |
|
75 | } |
|
76 | ||
77 | $this->model->setAttribute($key, $value); |
|
78 | } |
|
@@ 97-99 (lines=3) @@ | ||
94 | foreach (\Request::except('_token') as $key => $value) { |
|
95 | ||
96 | // Could swap this out for model -> getAttribute, then check if we have an attribute or a relation... getRelationValue() is helpful |
|
97 | if (method_exists($this->model, $key) && is_a(call_user_func_array([$this->model, $key], []), 'Illuminate\Database\Eloquent\Relations\Relation')) { |
|
98 | $this->saveRelation('afterSave', $key, $value); |
|
99 | } |
|
100 | } |
|
101 | ||
102 | } |