|
@@ 64-68 (lines=5) @@
|
| 61 |
|
throw new DisplayValidationException(json_encode($validator->errors())); |
| 62 |
|
} |
| 63 |
|
|
| 64 |
|
if (isset($data['config_from'])) { |
| 65 |
|
if (! ServiceOption::where('service_id', $data['service_id'])->where('id', $data['config_from'])->first()) { |
| 66 |
|
throw new DisplayException('The `configuration from` directive must be a child of the assigned service.'); |
| 67 |
|
} |
| 68 |
|
} |
| 69 |
|
|
| 70 |
|
return ServiceOption::create($data); |
| 71 |
|
} |
|
@@ 147-151 (lines=5) @@
|
| 144 |
|
throw new DisplayValidationException(json_encode($validator->errors())); |
| 145 |
|
} |
| 146 |
|
|
| 147 |
|
if (isset($data['config_from'])) { |
| 148 |
|
if (! ServiceOption::where('service_id', $option->service_id)->where('id', $data['config_from'])->first()) { |
| 149 |
|
throw new DisplayException('The `configuration from` directive must be a child of the assigned service.'); |
| 150 |
|
} |
| 151 |
|
} |
| 152 |
|
|
| 153 |
|
$option->fill($data)->save(); |
| 154 |
|
|