From 7c6814a6e7184a90cb3514d7f7361cdb0220c5b2 Mon Sep 17 00:00:00 2001 From: Tarvo Reinpalu Date: Fri, 19 Jul 2019 10:15:38 +0300 Subject: [PATCH] Update CHANGELOG.md --- CHANGELOG.md | 7 +++++++ src/Models/Menu.php | 6 +++--- src/Models/MenuItem.php | 2 +- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e89c9887..7b9e0847 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [1.3.1] - 2019-07-19 + +### Changed + +- Order menu items by 'order' value by [@kaareloun](https://github.com/kaareloun) + ## [1.3.0] - 2019-06-13 ### Added @@ -91,6 +97,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Nesting and re-ordering of menu-items - Creation of custom link options (ie links to Laravel models) +[1.3.1]: https://github.com/optimistdigital/nova-menu-builder/compare/1.3.0...1.3.1 [1.3.0]: https://github.com/optimistdigital/nova-menu-builder/compare/1.2.1...1.3.0 [1.2.1]: https://github.com/optimistdigital/nova-menu-builder/compare/1.2.0...1.2.1 [1.2.0]: https://github.com/optimistdigital/nova-menu-builder/compare/1.1.4...1.2.0 diff --git a/src/Models/Menu.php b/src/Models/Menu.php index 38458cd0..50e49ea3 100644 --- a/src/Models/Menu.php +++ b/src/Models/Menu.php @@ -12,9 +12,9 @@ public function rootMenuItems() return $this ->hasMany(MenuItem::class) ->where('parent_id', null) - ->orderby('parent_id') - ->orderby('order') - ->orderby('name'); + ->orderBy('parent_id') + ->orderBy('order') + ->orderBy('name'); } public function formatForAPI() diff --git a/src/Models/MenuItem.php b/src/Models/MenuItem.php index f0c534e6..5f37512b 100644 --- a/src/Models/MenuItem.php +++ b/src/Models/MenuItem.php @@ -25,7 +25,7 @@ public function menu() public function children() { - return $this->hasMany(self::class, 'parent_id')->with('children')->orderby('order'); + return $this->hasMany(self::class, 'parent_id')->with('children')->orderBy('order'); } public function itemsChildren($parentId)