@@ -65,7 +65,7 @@ discard block |
||
| 65 | 65 | ->orderBy('sort', 'ASC') |
| 66 | 66 | ->get(); |
| 67 | 67 | |
| 68 | - return $relations->map(function (Relation $relation) { |
|
| 68 | + return $relations->map(function(Relation $relation) { |
|
| 69 | 69 | $parent = $relation->parent; |
| 70 | 70 | $parent->relation = $relation; |
| 71 | 71 | |
@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | ->orderBy('sort', 'ASC') |
| 82 | 82 | ->get(); |
| 83 | 83 | |
| 84 | - return $relations->map(function (Relation $relation) use ($parent_type, $parent_id) { |
|
| 84 | + return $relations->map(function(Relation $relation) use ($parent_type, $parent_id) { |
|
| 85 | 85 | |
| 86 | 86 | // It could be that the child itself is archived, soft-deleted or removed. If this is the case, we will ignore it and move on. |
| 87 | 87 | if (!$child = $relation->child) { |
@@ -94,7 +94,7 @@ discard block |
||
| 94 | 94 | }) |
| 95 | 95 | |
| 96 | 96 | // In case of soft-deleted entries, this will be null and should be ignored. We make sure that keys are reset in case of removed child |
| 97 | - ->reject(function ($child) { |
|
| 97 | + ->reject(function($child) { |
|
| 98 | 98 | return is_null($child); |
| 99 | 99 | }) |
| 100 | 100 | ->values(); |
@@ -111,10 +111,10 @@ discard block |
||
| 111 | 111 | |
| 112 | 112 | public static function deleteRelationsOf($type, $id) |
| 113 | 113 | { |
| 114 | - $relations = static::where(function ($query) use ($type, $id) { |
|
| 114 | + $relations = static::where(function($query) use ($type, $id) { |
|
| 115 | 115 | return $query->where('parent_type', $type) |
| 116 | 116 | ->where('parent_id', $id); |
| 117 | - })->orWhere(function ($query) use ($type, $id) { |
|
| 117 | + })->orWhere(function($query) use ($type, $id) { |
|
| 118 | 118 | return $query->where('child_type', $type) |
| 119 | 119 | ->where('child_id', $id); |
| 120 | 120 | })->get(); |
@@ -126,7 +126,7 @@ discard block |
||
| 126 | 126 | |
| 127 | 127 | public static function deleteAllChildRelationsOf($type, $id) |
| 128 | 128 | { |
| 129 | - $relations = static::where(function ($query) use ($type, $id) { |
|
| 129 | + $relations = static::where(function($query) use ($type, $id) { |
|
| 130 | 130 | return $query->where('parent_type', $type) |
| 131 | 131 | ->where('parent_id', $id); |
| 132 | 132 | })->get(); |
@@ -138,7 +138,7 @@ discard block |
||
| 138 | 138 | |
| 139 | 139 | public static function deleteAllParentRelationsOf($type, $id) |
| 140 | 140 | { |
| 141 | - $relations = static::where(function ($query) use ($type, $id) { |
|
| 141 | + $relations = static::where(function($query) use ($type, $id) { |
|
| 142 | 142 | return $query->where('child_type', $type) |
| 143 | 143 | ->where('child_id', $id); |
| 144 | 144 | })->get(); |