Browse Source

Add spaceship

Visman 1 year ago
parent
commit
8ade529ff8
1 changed files with 1 additions and 5 deletions
  1. 1 5
      app/Models/Page.php

+ 1 - 5
app/Models/Page.php

@@ -376,11 +376,7 @@ abstract class Page extends Model
         }
         }
 
 
         \uasort($this->pageHeaders, function (array $a, array $b) {
         \uasort($this->pageHeaders, function (array $a, array $b) {
-            if ($a['weight'] === $b['weight']) {
-                return 0;
-            } else {
-                return $a['weight'] > $b['weight'] ? -1 : 1;
-            }
+            return $b['weight'] <=> $a['weight'];
         });
         });
 
 
         return $this->pageHeaders;
         return $this->pageHeaders;