Skip to content
This repository was archived by the owner on Nov 20, 2025. It is now read-only.

Commit 3c974f2

Browse files
authored
Update Loadable.php
1 parent af9e59e commit 3c974f2

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

src/Loadable/Loadable.php

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,23 @@ public function loadable($load)
2323
}
2424

2525
/**
26-
* Get loadable releations.
26+
* Get loadable relations.
2727
*/
2828
private function getLoadableRelations(): array
2929
{
30-
return $this->loadable ?? [];
30+
$rels = $this->loadable ?? [];
31+
$result = [];
32+
foreach ($rels as $element) {
33+
$parts = explode('.', $element);
34+
$temp = '';
35+
foreach ($parts as $part) {
36+
$temp .= $part;
37+
if (!in_array($temp, $result)) {
38+
array_push($result, $temp);
39+
}
40+
$temp .= '.';
41+
}
42+
}
43+
return $result;
3144
}
3245
}

0 commit comments

Comments
 (0)