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