Conditions | 2 |
Paths | 2 |
Total Lines | 12 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
12 | public function __invoke(ValidateFamilyRequest $request, $family) |
||
13 | { |
||
14 | $family = Family::find($family); |
||
15 | |||
16 | if ($family) { |
||
17 | $family->update($request->validated()); |
||
18 | $family->children()->update(['child_in_family_id' => null]); |
||
19 | $family->children()->saveMany(Person::whereIn('id', $request->get('child_id', []))->get()); |
||
20 | } |
||
21 | //return with 404 |
||
22 | |||
23 | return ['message' => __('The family was successfully updated')]; |
||
24 | } |
||
26 |