@@ -36,7 +36,7 @@ discard block  | 
                                                    ||
| 36 | 36 | |
| 37 | 37 | public function onlyModules(): Collection  | 
                                                        
| 38 | 38 |      { | 
                                                        
| 39 | -        return $this->collection()->reject(function ($item) { | 
                                                        |
| 39 | +        return $this->collection()->reject(function($item) { | 
                                                        |
| 40 | 40 |              if ($item instanceof Page || $item instanceof StoredSetReference) { | 
                                                        
| 41 | 41 | return true;  | 
                                                        
| 42 | 42 | }  | 
                                                        
@@ -45,7 +45,7 @@ discard block  | 
                                                    ||
| 45 | 45 | |
| 46 | 46 | public function onlyPages(): Collection  | 
                                                        
| 47 | 47 |      { | 
                                                        
| 48 | -        return $this->collection()->filter(function ($item) { | 
                                                        |
| 48 | +        return $this->collection()->filter(function($item) { | 
                                                        |
| 49 | 49 |              if ($item instanceof Page) { | 
                                                        
| 50 | 50 | return true;  | 
                                                        
| 51 | 51 | }  | 
                                                        
@@ -75,12 +75,12 @@ discard block  | 
                                                    ||
| 75 | 75 | |
| 76 | 76 | // Merging the results of all the pages and all the modules, then filter by the config  | 
                                                        
| 77 | 77 | // This prevents us from having duplicates and also reduces the query load.  | 
                                                        
| 78 | -        $collection = $collection->filter(function ($page) use ($available_children_types) { | 
                                                        |
| 78 | +        $collection = $collection->filter(function($page) use ($available_children_types) { | 
                                                        |
| 79 | 79 | return in_array(get_class($page), $available_children_types);  | 
                                                        
| 80 | 80 | });  | 
                                                        
| 81 | 81 | |
| 82 | 82 | // Filter out our already loaded pages and modules  | 
                                                        
| 83 | -        $remaining_children_types = collect($available_children_types)->reject(function ($type) { | 
                                                        |
| 83 | +        $remaining_children_types = collect($available_children_types)->reject(function($type) { | 
                                                        |
| 84 | 84 | return (new $type() instanceof Page || new $type() instanceof Module);  | 
                                                        
| 85 | 85 | });  | 
                                                        
| 86 | 86 | |
@@ -92,12 +92,12 @@ discard block  | 
                                                    ||
| 92 | 92 | }  | 
                                                        
| 93 | 93 | |
| 94 | 94 | // Remove duplicate models  | 
                                                        
| 95 | -        $collection = $collection->unique(function($model){ | 
                                                        |
| 95 | +        $collection = $collection->unique(function($model) { | 
                                                        |
| 96 | 96 | return (new FlatReference(get_class($model), $model->id))->get();  | 
                                                        
| 97 | 97 | });  | 
                                                        
| 98 | 98 | |
| 99 | 99 | // Filter out our parent  | 
                                                        
| 100 | -        return $this->collection = $collection->reject(function ($item) { | 
                                                        |
| 100 | +        return $this->collection = $collection->reject(function($item) { | 
                                                        |
| 101 | 101 |              if ($item instanceof $this->parent) { | 
                                                        
| 102 | 102 | return $item->id == $this->parent->id;  | 
                                                        
| 103 | 103 | }  |