99
1010namespace TypiCMS ;
1111
12- use App ;
1312use Illuminate \Database \Eloquent \Collection ;
1413use Illuminate \Support \Arr ;
1514use Illuminate \Support \Collection as BaseCollection ;
@@ -78,7 +77,7 @@ public function nest()
7877 }
7978
8079 // Add items to children collection.
81- foreach ($ collection ->items as $ key => $ item ) {
80+ foreach ($ collection ->items as $ item ) {
8281 if ($ item ->{$ parentColumn } && isset ($ collection [$ item ->{$ parentColumn }])) {
8382 $ collection [$ item ->{$ parentColumn }]->{$ this ->childrenName }->push ($ item );
8483 $ keysToDelete [] = $ item ->id ;
@@ -95,11 +94,11 @@ public function nest()
9594 * Recursive function that flatten a nested Collection
9695 * with characters (default is four spaces).
9796 *
98- * @param string $column
99- * @param int $level
100- * @param array &$flattened
101- * @param string| null $indentChars
102- * @param string|boolen|null $parent_string
97+ * @param string $column
98+ * @param int $level
99+ * @param array &$flattened
100+ * @param null|string $indentChars
101+ * @param null|bool|string $parent_string
103102 *
104103 * @return array
105104 */
@@ -214,6 +213,7 @@ public function getTotal()
214213 public function setParents ()
215214 {
216215 $ this ->setParentsRecursive ($ this );
216+
217217 return $ this ;
218218 }
219219
0 commit comments