Conditions | 2 |
Paths | 1 |
Total Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
34 | public static function getIndividualRelationshipPathsFromInclude(string $include): Collection |
||
35 | { |
||
36 | return collect(explode('.', $include)) |
||
37 | ->reduce(function ($includes, $relationship) { |
||
38 | if ($includes->isEmpty()) { |
||
39 | return $includes->push($relationship); |
||
40 | } |
||
41 | |||
42 | return $includes->push("{$includes->last()}.{$relationship}"); |
||
43 | }, collect()); |
||
44 | } |
||
45 | } |
||
46 |