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