| @@ 112-122 (lines=11) @@ | ||
| 109 | * |
|
| 110 | * @param array $input |
|
| 111 | */ |
|
| 112 | public function updateMessagesSettings(array $input) |
|
| 113 | { |
|
| 114 | return (new Project\User()) |
|
| 115 | ->where('user_id', '=', $this->id) |
|
| 116 | ->whereIn('project_id', array_keys($input)) |
|
| 117 | ->get() |
|
| 118 | ->each(function (Project\User $project) use ($input) { |
|
| 119 | $project->message_id = $input[$project->project_id]; |
|
| 120 | $project->save(); |
|
| 121 | }); |
|
| 122 | } |
|
| 123 | ||
| 124 | /** |
|
| 125 | * Fill the model with an array of attributes. |
|
| @@ 97-107 (lines=11) @@ | ||
| 94 | * |
|
| 95 | * @param array $input |
|
| 96 | */ |
|
| 97 | public function updateMessagesSettings(array $input) |
|
| 98 | { |
|
| 99 | return (new ProjectUser()) |
|
| 100 | ->where('user_id', '=', $this->model->id) |
|
| 101 | ->whereIn('project_id', array_keys($input)) |
|
| 102 | ->get() |
|
| 103 | ->each(function (ProjectUser $project) use ($input) { |
|
| 104 | $project->message_id = $input[$project->project_id]; |
|
| 105 | $project->save(); |
|
| 106 | }); |
|
| 107 | } |
|
| 108 | } |
|
| 109 | ||